10000 Limitless LED is not initialized after upgrade from 0.38.1 · Issue #6286 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Limitless LED is not initialized after upgrade from 0.38.1 #6286

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

Closed
janLo opened this issue Feb 27, 2017 · 6 comments
Closed

Limitless LED is not initialized after upgrade from 0.38.1 #6286

janLo opened this issue Feb 27, 2017 · 6 comments

Comments

@janLo
Copy link
Contributor
janLo commented Feb 27, 2017

Home Assistant release (hass --version): 0.39.1

Python release (python3 --version): 3.4.2

Component/platform: light/limitlessled

Description of problem:
After the upgrade from 0.38.1 to 0.39.1 the limitlessled cmponent does not initialize anymore and a stacktrace is dumped in the log. The "beaking changes" in the release motes say something about the need to define a port/version in this release but the documentation and the code tells its optional.

Expected:
The component should initialize.

Problem-relevant configuration.yaml entries and steps to reproduce:

light:
  platform: limitlessled
  bridges:
    - host: milight-controller-1
      groups:
        - number: 1
          type: rgbw
          name: xxx
        - number: 2
          type: rgbw
          name: yyy
        - number: 3
          type: rgbw
          name: zzz
        - number: 4
          type: rgbw
          name: kkk

Traceback (if applicable):

17-02-27 18:50:42 INFO (MainThread) [homeassistant.components.light] Setting up light.limitlessled
Exception in thread Thread-15:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "/home/hass/.homeassistant/deps/limitlessled/bridge.py", line 230, in _keep_alive
    self._send_raw(command)
  File "/home/hass/.homeassistant/deps/limitlessled/bridge.py", line 195, in _send_raw
    self._socket.send(bytearray(command))
TypeError: an integer is required

17-02-27 18:50:47 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform limitlessled
Traceback (most recent call last):
  File "/home/hass/hass_env/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/hass/hass_env/lib/python3.4/site-packages/homeassistant/components/light/limitlessled.py", line 118, in setup_platform
    lights.append(LimitlessLEDGroup.factory(group))
  File "/home/hass/hass_env/lib/python3.4/site-packages/homeassistant/components/light/limitlessled.py", line 176, in factory
    return LimitlessLEDRGBWGroup(group)
  File "/home/hass/hass_env/lib/python3.4/site-packages/homeassistant/components/light/limitlessled.py", line 254, in __init__
    self.group.on = True
  File "/home/hass/.homeassistant/deps/limitlessled/group/__init__.py", line 83, in on
    cmd = self.command_set.off()
  File "/home/hass/.homeassistant/deps/limitlessled/group/commands/v6.py", line 244, in off
    return self._build_command(0x03, 0x02)
  File "/home/hass/.homeassistant/deps/limitlessled/group/commands/v6.py", line 111, in _build_command
    self._group_number)
  File "/home/hass/.homeassistant/deps/limitlessled/group/commands/__init__.py", line 43, in __init__
    self._bytes = bytearray(bytes)
TypeError: an integer is required

Additional info:

@janLo
Copy link
Contributor Author
janLo commented Feb 27, 2017

After an restart the error has disappeared and was not reproducible even after three restarts.

@happyleavesaoc
Copy link
Contributor

Note that version and port are not optional if you're not using the latest bridge.

@janLo
Copy link
Contributor Author
janLo commented Feb 27, 2017

Please mention in the documentation, that this has changed, as it breaks the component for all existing users. Everyone who used milight before have to set the version to and the port to 8899.

Actually I think, we should select the default port according to the version, as the milight controller has no option to manually change the port at all. So it makes no sense, that the user has to change both. And the ports and versions should be mentioned in the documentation. At the moment the only option to find the right port to make the setup working again is by reading the diff of the component. And maybe make the version mandatory, as the component does not work with the more common V5 devices - and just give a meaningless exception.

@balloob
Copy link
Member
balloob commented Mar 3, 2017

Would it be possible to detect if we are trying to connect to a v5 bridge and either use different defaults or at least warn the user?

@janLo
Copy link
Contributor Author
janLo commented Mar 3, 2017

At least we get the exception above if we use v6 on a v5 bridge.

@corneyl
Copy link
Contributor
corneyl commented May 3, 2017

The particular line of code which causes the exception is removed in v1.0.6, and I've tested with this version without getting this error. With v1.0.5 I got this error and traceback quite frequently.
I'll try to create a merge request as soon a new version is out, which also fixes reconnects for unstable connections.

@home-assistant home-assistant locked and limited conversation to collaborators Aug 12, 2017
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
0