syssi / chuangmi_ir

Xiaomi Zhimi Floor Fan and Chuangmi IR Controller integration for Home Assistant
27 stars 5 forks source link

Chuang_mi_ir_switch not work on a frontend #4

Closed Alex0302 closed 7 years ago

Alex0302 commented 7 years ago

Hello! When I try to turn on or turn off Chuang_mi_ir_switch on the frontend of Hass, nothing happens, only debug messages in log - "Empty packet skipped." I think that the problem is the following piece of code: https://github.com/syssi/chuangmi_ir/blob/40ab3ed4689eabc93f5b406a43c87018900e20e9/custom_components/switch/chuangmi_ir.py#L195 packet = str(packet) if packet: LOGGER.debug("Empty packet skipped.") return True

If you change the line 195 in " if packet is None" all works fine.

P.S. Sorry for my english. Thank's for the great work.

syssi commented 7 years ago

My fault! It's fixed with 950b6fc6d99002941e3aa137926cbab2979f2ffa.