bodyscape / cielo_home

Integration with Cielo Home
Apache License 2.0
44 stars 10 forks source link

Unable to use any device controls. KeyError: 'turbo' #3

Closed ekaganovich closed 1 year ago

ekaganovich commented 1 year ago

Error after adding integration:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/cielo_home/cielohomedevice.py:316
Integration: Cielo Home (documentation, issues)
First occurred: 6:25:36 AM (1 occurrences)
Last logged: 6:25:36 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/cielo_home/cielohome.py", line 243, in async_connect_wss
    listener.lost_connection()
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 649, in lost_connection
    self.dispatch_state_updated()
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 644, in dispatch_state_updated
    listener.state_updated()
  File "/config/custom_components/cielo_home/entity.py", line 36, in state_updated
    self._update_internal_state()
  File "/config/custom_components/cielo_home/climate.py", line 107, in _update_internal_state
    self._attr_preset_mode = self._device.get_preset_mode()
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 527, in get_preset_mode
    if self.get_turbo() == "on":
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 316, in get_turbo
    return self._device["latestAction"]["turbo"]
KeyError: 'turbo'

Error toggling any device controls:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/cielo_home/cielohomedevice.py:342
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 6:37:35 AM (1 occurrences)
Last logged: 6:37:35 AM

[139913008286880] 'turbo'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1787, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1824, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 680, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 720, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1022, in async_turn_on
    await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/cielo_home/switch.py", line 41, in turn_on
    self._device.send_power_on()
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 46, in send_power_on
    self._send_power("on")
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 57, in _send_power
    action = self._get_action()
  File "/config/custom_components/cielo_home/cielohomedevice.py", line 342, in _get_action
    "turbo": self._device["latestAction"]["turbo"],
KeyError: 'turbo'
bodyscape commented 1 year ago

@ekaganovich try the version 1.3.5 ;)