fredericvl / py-agua-iot

py-agua-iot provides controlling heating devices connected via the IOT Agua platform of Micronova
Apache License 2.0
31 stars 16 forks source link

Use temp_probe_k_get as a fallback for property gas_temperature #59

Closed yvesjans closed 1 year ago

yvesjans commented 1 year ago

Some stoves expose the temp_probe_k_get reg type instead of temp_gas_flue_get. This makes the module throw an exception:

  File "/Users/yves/git/yves/py-agua-iot/py_agua_iot/__init__.py", line 623, in gas_temperature
    return float(self.__get_information_item('temp_gas_flue_get'))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yves/git/yves/py-agua-iot/py_agua_iot/__init__.py", line 440, in __get_information_item
    formula = self.__register_map_dict[item]['formula']
              ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'temp_gas_flue_get'

It also makes the Home Assistant integration setup fail as the attribute is called here: https://github.com/vincentwolsink/home_assistant_micronova_agua_iot/blob/master/custom_components/aguaiot/const.py#L9

Related issues/more context: https://github.com/fredericvl/py-agua-iot/issues/4#issuecomment-787040488 https://github.com/fredericvl/py-agua-iot/issues/53

vincentwolsink commented 1 year ago

Thanks!