Skip to content

memtemp-plus: KeyError crashes when config options missing #11

@CoderFX

Description

@CoderFX

Bug

memtemp-plus.py crashes with KeyError when config options are not set in config.toml:

  1. self.options['scale'] in cpu_temp() — crashes if scale not configured
  2. self.options['orientation'] in on_ui_setup, on_unload, on_ui_update — crashes if orientation not configured
  3. self.fields not initialized in __init__AttributeError if on_unload called before on_ui_setup
  4. cpu_freq() reads sysfs file without error handling — crashes if file doesn't exist

Steps to Reproduce

Add [main.plugins.memtemp-plus] with enabled = true but without setting scale or orientation.

Fix

PRs incoming with .get() defaults and error handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions