python-broadlink: check_nightlight with python3 not working
Using broadlink-0.8 in python2.7 all is working, but I need the lib in python3.5 and there I get following error when calling set_power():
2018-04-01 20:34:57 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall broadlink_switch.set_on>
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1010, in _event_to_service_call
await self._hass.async_add_job(execute_service)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1007, in execute_service
service_handler.func(service_call)
File "/home/homeassistant/.homeassistant/custom_components/broadlink_switch.py", line 30, in set_on_service
switch_all(True)
File "/home/homeassistant/.homeassistant/custom_components/broadlink_switch.py", line 15, in switch_all
devices[j].set_power(toOn)
File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 394, in set_power
File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 432, in check_nightlight
TypeError: ord() expected string of length 1, but int found
This seems to be a problem with code not adapted to python3. Look for example here on stackoverflow.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (9 by maintainers)
Commits related to this issue
- try to fix #171 — committed to Nightreaver/python-broadlink by mvsbarthen 6 years ago
I put that line into the code, but it still showing the same error. The output of the pip freeze is: