klali / ha-plejd

Plejd component for Home Assistant
Apache License 2.0
69 stars 16 forks source link

Exception while access self._brightness #35

Closed jonsv322 closed 3 years ago

jonsv322 commented 3 years ago

Access to self._brightness was accessed before it has been declarated causing an exception in brightness method.

home-assistant   |     data[ATTR_BRIGHTNESS] = self.brightness
home-assistant   |   File "/config/custom_components/plejd/light.py", line 111, in brightness
home-assistant   |     if self._brightness:
home-assistant   | AttributeError: 'PlejdLight' object has no attribute '_brightness'