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.23k stars 2.49k forks source link

KeyError: 'extraRinse1' after update to 0.7.X #38

Closed KiraPC closed 11 months ago

KiraPC commented 1 year ago

After the latest update, I'm receiving the issue

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 193, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 341, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 142, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 401, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 568, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 632, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 574, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1016, in state
    if (is_on := self.is_on) is None:
  File "/config/custom_components/hon/switch.py", line 360, in is_on
    setting = self._device.settings[self.entity_description.key]
KeyError: 'extraRinse1'

This avoid the component to load the other appliance attributes and all the attributes appear unavailable.

Andre0512 commented 1 year ago

Hi, did you test also the v0.7.2? Thought it was fixed there 🤔

KiraPC commented 1 year ago

Yes, i've installed the 0.7.2

Andre0512 commented 1 year ago

I have an idea where the problem is, I will fix that later today.

KiraPC commented 1 year ago

No hurry. I'm using a local fix as a workaround.

Anyway the integration does not provide temperature and current program now.

Andre0512 commented 1 year ago

Sorry, I changed too much 🥴 Which device do you use? (appliancetype, brand, model)

KiraPC commented 1 year ago

It is a Candy WashDry RPW4966BWMR/1-S

Andre0512 commented 1 year ago

I think the KeyError should be fixed now, can you please test v0.7.3-beta.2 to verify this? :slightly_smiling_face: I added the temperature sensor again, but which program entity are you missing? I changed the prCode to the correct name recently, do you mean this? Can't you see the new sensor or do you really need the prCode?

KiraPC commented 1 year ago

OK, i tested the latest beta and working.

Which is the new prCode?

Andre0512 commented 1 year ago

Thanks! The key is now programName, here we have a look at the corresponding program and display now the program key (eg hqd_quick_dry) and if available the translation of the program name :slightly_smiling_face: