Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadlink plateform broken on 0.67 (update available) #13998

Closed
grea09 opened this issue Apr 19, 2018 · 3 comments
Closed

Broadlink plateform broken on 0.67 (update available) #13998

grea09 opened this issue Apr 19, 2018 · 3 comments

Comments

@grea09
Copy link
Contributor

grea09 commented Apr 19, 2018

Home Assistant release with the issue:
0.67.1

Last working Home Assistant release (if known):

0.66.1

Operating environment (Hass.io/Docker/Windows/etc.):
Python install on Ubuntu derivative

Component/platform:
broadlink

Description of problem:
The files in homeassistant/deps/lib/python3.6/site-packages/broadlink/ are out of date and causes errors.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

- platform: broadlink
  host: 192.168.1.23
  mac: '34:EA:34:F5:25:03'
  icon: mdi:spotlight-beam
  friendly_name: floor_lamp
  type: spmini2

Traceback (if applicable):

2018-04-19 16:45:04 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1524149104.131136, level=ERROR, message=Update for switch.blue_neon fails, exception=Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/switch/broadlink.py", line 293, in update
    self._update()
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/switch/broadlink.py", line 298, in _update
    state = self._device.check_power()
  File "/etc/homeassistant/deps/lib/python3.6/site-packages/broadlink/__init__.py", line 418, in check_power
    if ord(payload[0x4]) == 1 or ord(payload[0x4]) == 3:
TypeError: ord() expected string of length 1, but int found
, source=deps/lib/python3.6/site-packages/broadlink/__init__.py>
2018-04-19 16:45:04 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.clock fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/switch/broadlink.py", line 293, in update
    self._update()
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/switch/broadlink.py", line 298, in _update
    state = self._device.check_power()
  File "/etc/homeassistant/deps/lib/python3.6/site-packages/broadlink/__init__.py", line 418, in check_power
    if ord(payload[0x4]) == 1 or ord(payload[0x4]) == 3:
TypeError: ord() expected string of length 1, but int found

Additional information:
New version of the file available at https://github.com/mjg59/python-broadlink/blob/master/broadlink/__init__.py

Related to : https://community.home-assistant.io/t/breaking-change-on-0-67-for-broadlink/50514/10

@Breakerz
Copy link

Breakerz commented Apr 19, 2018

same here, version 0.67.1

2018-04-19 15:39:33 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.chambre fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  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/components/switch/broadlink.py", line 293, in update
    self._update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/broadlink.py", line 298, in _update
    state = self._device.check_power()
  File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 418, in check_power
    if ord(payload[0x4]) == 1 or ord(payload[0x4]) == 3:
TypeError: ord() expected string of length 1, but int found

@grea09
Copy link
Contributor Author

grea09 commented Apr 19, 2018

Temporary fix is to remplace the file causing the error with the updated version here (always backup first)
Edit: closing the issue was just a button mistake

@Alessandro1981
Copy link

Hello, How can I replace the init.py file?...I am not finding the right folder on hassio

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants