nicole-ashley / homeassistant-goldair-climate

Home Assistant integration for Goldair WiFi heaters, dehumidifiers and fans
MIT License
20 stars 10 forks source link

Problem initialising the dehumidifieir - ValueError: None is not in list #43

Open Dean-Moor opened 3 years ago

Dean-Moor commented 3 years ago

Problem initialising the dehumidifieir. I am getting the following in the HA Core log at initial startup of the component;

ERROR (MainThread) [homeassistant.components.climate] Error while setting up goldair_climate platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 239, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 478, in _async_add_entity
    original_icon=entity.icon,
  File "/config/custom_components/goldair_climate/dehumidifier/climate.py", line 88, in icon
    if self.tank_full_or_missing:
  File "/config/custom_components/goldair_climate/dehumidifier/climate.py", line 279, in tank_full_or_missing
    GoldairTuyaDevice.get_key_for_value(ERROR_CODE_TO_DPS_CODE, error)
  File "/config/custom_components/goldair_climate/device.py", line 252, in get_key_for_value
    return keys[values.index(value)] or fallback
ValueError: None is not in list

After this has appeared a few times, subsequent refereshes seem to be failing with; [custom_components.goldair_climate.device] Failed to refresh device state for <deviceName>.

Any advice or pointers would be greatly appreaciated. Thanks

nicole-ashley commented 3 years ago

Thanks for your report! It looks like your dehumidifier is returning an error code that this integration isn't expecting, and I haven't programmed it to gracefully fall back to a generic error (my bad!). To help me fix this, would you mind providing the following:

  1. Your model of dehumidifier
  2. Any error or alert states your dehumidifer may currently be in (a photo of the display and a screenshot of the Goldair app would be handy)
  3. Some debug logs to help me see what the underlying error code is (add this to your configuration.yaml and then restart to enable debug logging):
    logger:
    default: warning
    logs:
    custom_components.goldair_climate: debug

With all of that information I should be able to take a stab at fixing this.