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

[Bug] Lights fail to load in the latest code #81

Open
ryanwaldron opened this issue Dec 2, 2022 · 1 comment
Open

[Bug] Lights fail to load in the latest code #81

ryanwaldron opened this issue Dec 2, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ryanwaldron
Copy link

Describe the bug
Lights fail to load with latest code.

To Reproduce
Steps to reproduce the behavior:
Install HA
Manually install SengledApi
Restart HA

Expected behavior
Lights to show up in the UI

System configuration
Home Assistant 2022.11.4
Frontend 20221108.0 - latest
SengledApi Version: Latest Master

configuration.yaml

sengledapi:
  username: ********@gmail.com
  password: ***************
  country: us
  wifi: true

home-assistant.log

Logger: homeassistant.components.light
Source: custom_components/sengledapi/light.py:160
Integration: Light ([documentation](https://www.home-assistant.io/integrations/light), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+light%22))
First occurred: 9:17:23 AM (2 occurrences)
Last logged: 9:17:23 AM

Error adding entities for domain light with platform sengledapi
Error while setting up sengledapi platform for light
Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/local/share/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 605, in _async_add_entity
    capabilities=entity.capability_attributes,
  File "/usr/local/share/homeassistant/lib/python3.10/site-packages/homeassistant/components/light/__init__.py", line 910, in capability_attributes
    supported_features = self.supported_features
  File "/home/homeassistant/homeassistant/custom_components/sengledapi/light.py", line 160, in supported_features
    features = ColorMode.BRIGHTNESS | ColorMode.COLOR_TEMP
TypeError: unsupported operand type(s) for |: 'ColorMode' and 'ColorMode'
@ryanwaldron ryanwaldron added the bug Something isn't working label Dec 2, 2022
@ryanwaldron ryanwaldron changed the title [Bug] [Bug] Lights fail to load in the latest code Dec 2, 2022
@HaydenAlbrey
Copy link

I faced this issue today when trying to set up this integration. However I believe I have the solution.

The line referenced in the error File ".../light.py", line 160 is different in the version that is installed through HACS and that installed via direct download. The version on HACS does not have this bug. Try installing it though HACS and see if the issue goes away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants