lazcad / homeassistant

Home Assistant Development
249 stars 83 forks source link

Error for gateway light #18

Closed aferraz closed 7 years ago

aferraz commented 7 years ago

Hi, after your last commit I have this error: 17-01-29 19:03:13 homeassistant.components.light: Error while setting up platform xiaomi Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform entity_platform.add_entities, discovery_info File "/usr/lib64/python3.5/asyncio/futures.py", line 361, in iter yield self # This tells Task to wait for completion. File "/usr/lib64/python3.5/asyncio/tasks.py", line 296, in _wakeup future.result() File "/usr/lib64/python3.5/asyncio/futures.py", line 274, in result raise self._exception File "/usr/lib64/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/opt/homeassistant/custom_components/light/xiaomi.py", line 26, in setup_platform add_devices([XiaomiGatewayLight(device, 'Gateway Light', gateway)]) File "/opt/homeassistant/custom_components/light/xiaomi.py", line 70, in init XiaomiDevice.init(self, device, name, xiaomi_hub) File "/opt/homeassistant/custom_components/light/xiaomi.py", line 35, in init self.parse_data(device['data']) File "/opt/homeassistant/custom_components/light/xiaomi.py", line 89, in parse_data rgba = struct.unpack('BBBB',rgbhex) struct.error: unpack requires a bytes object of length 4 Thanks Alessandro

Danielhiversen commented 7 years ago

Are you using the latest version?

Could you enable debug mode?


logger:
  default: warning
  logs:
    custom_components.light.xiaomi: debug

And just before the error message appear there should be something like 17-01-29 20:12:51 DEBUG (Thread-14) [custom_components.xiaomi] Received data {'data': '....... Post that line here.

aferraz commented 7 years ago

Hi Daniel, I deleted pycache and now work. Thnaks you