sampsyo / hass-smartthinq

Home Assistant component for LG SmartThinQ HVAC devices
MIT License
282 stars 98 forks source link

If AC off turning on throws error KeyError: '@AC_MAIN_OPERATION_ALL_ON_W' #45

Closed petarvucetin closed 4 years ago

petarvucetin commented 4 years ago

Thank you for making this happen. I tried few things to see if I can fix it. I tried wideq from your repo but I must be doing something wrong.

I am running HASS in ubuntu VM.

If AC is off turning it on from HASS gives this error:

 File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 356, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 384, in _handle_service_platform_call
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 422, in async_set_hvac_mode
    await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/smartthinq/climate.py", line 199, in set_hvac_mode
    self._ac.set_on(True)
  File "/usr/local/lib/python3.7/site-packages/wideq/ac.py", line 231, in set_on
    op_value = self.model.enum_value('Operation', op.value)
  File "/usr/local/lib/python3.7/site-packages/wideq/client.py", line 350, in enum_value
    return options_inv[name]
KeyError: '@AC_MAIN_OPERATION_ALL_ON_W'

Any suggestions?

sampsyo commented 4 years ago

That's odd! Looks like this is an incompatibility with your model and the wideq library, no the Home Assistant integration. Can you please open an issue there with some details—especially the output of example.py mon for your model?