cjkrolak / ThermostatSupervisor

supervisor to detect and correct thermostat deviations
MIT License
0 stars 0 forks source link

KeyError exception if battery status is None #721

Closed cjkrolak closed 10 months ago

cjkrolak commented 10 months ago

715 added battery status check, has a bug if battery status is None

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\github\ThermostatSupervisor\thermostatsupervisor\blink.py", line 499, in <module>
    tc.print_select_data_from_all_zones(
  File "C:\github\ThermostatSupervisor\thermostatsupervisor\thermostat_common.py", line 1205, in print_select_data_from_all_zones
    battery_status = battery_status_display[Zone.get_battery_status()]
                     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: None
cjkrolak commented 10 months ago

resolved by adding a key for None