Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.22k stars 2.5k forks source link

Error in sensor "phase" #183

Closed schblondie closed 1 month ago

schblondie commented 1 month ago

Hon becomes unavailable when wash-dryer comes in phase 8, it was in drying mode so phase 8 should be either also drying or cooling down, im not sure what it is doing in phase 8, nonetheless there should be a value defined, i would simple call it also "drying" until further information about phase 8 is found out. I will attach a small PR too.

Logger: homeassistant.components.sensor
Quelle: helpers/entity_platform.py:576
Integration: Sensor (Dokumentation, Probleme)
Erstmals aufgetreten: 16:12:46 (2 Vorkommnisse)
Zuletzt protokolliert: 16:19:37

Error adding entity sensor.waschtrockner_phase for domain sensor with platform hon
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 576, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 865, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1328, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1113, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1050, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 642, in state
    raise ValueError(
ValueError: Sensor sensor.waschtrockner_phase provides state value '8', which is not in the list of options provided
schblondie commented 1 month ago

See #184

Andre0512 commented 1 month ago

Thanks for fixing :smiley: