PimDoos / onesmartcontrolha

Home Assisttant integration for One Smart Control server
Apache License 2.0
4 stars 1 forks source link

Exception in update when dispatching 'onesmartcontrol_apparatus': () #49

Closed djoenez closed 1 year ago

djoenez commented 1 year ago

Hello,

Great work on this add-on! thanks alot! I do get spammed by this error:

2023-04-07 10:55:56.358 ERROR (MainThread) [homeassistant.util.logging] Exception in update when dispatching 'onesmartcontrol_apparatus': () Traceback (most recent call last): File "/config/custom_components/onesmartcontrol/onesmartentity.py", line 42, in update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 602, in _async_write_ha_state attr.update(self.state_attributes or {}) File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 988, in state_attributes color_mode = self._light_internal_color_mode File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 823, in _light_internal_color_mode if ColorMode.BRIGHTNESS in supported and self.brightness is not None: File "/config/custom_components/onesmartcontrol/light.py", line 101, in brightness if ColorMode.BRIGHTNESS in self._supported_color_modes: AttributeError: 'OneSmartLight' object has no attribute '_supported_color_modes'

It seems that my lights do not have the attribute: supported_color_modes. do i have to set something on my side?

PimDoos commented 1 year ago

Thanks for reporting, looks like this is a bug in the integration. I'll look into it.

PimDoos commented 1 year ago

Can you try if this is fixed in 0.3.5?