gvigroux / hon

Support of all Haier, Candy, Hoover appliances integrated in the official hOn mobile app. Direct access to all possible services and parameters
MIT License
118 stars 45 forks source link

Integration fails to start with Virtual Wine Cellar #37

Closed isomeruk closed 1 year ago

isomeruk commented 1 year ago

The 'Free' Virtual Wine Cellar/Cooler that is added to the hOn app at sign-up prevents the integration starting with the error below, presumably due to the virtual appliance having no physical mac address.

Removing the (pointless) device from the hOn app makes the error go away :)

2023-01-08 16:43:29.028 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hon which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-08 16:43:51.313 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up hon platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/hon/sensor.py", line 121, in async_setup_entry
    coordinator = HonCoolerCoordinator(hass, hon, appliance)
  File "/config/custom_components/hon/cooler.py", line 27, in __init__
    self._mac = appliance["macAddress"]
KeyError: 'macAddress'
gvigroux commented 1 year ago

I tried to create a new account and there is no more virtual device. In any case, I've added a check, it should not crash anymore.