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

Cannot setup example_light #13

Open
h4de5 opened this issue Nov 10, 2019 · 6 comments
Open

Cannot setup example_light #13

h4de5 opened this issue Nov 10, 2019 · 6 comments

Comments

@h4de5
Copy link

h4de5 commented Nov 10, 2019

I think the example configuration for example_light still uses an old identifier:

https://github.com/home-assistant/example-custom-config/blame/master/custom_components/example_light/README.md#L18

should be:

  • platform: example_light

I this is correct, I can create an PR but even with this change, I can't get it to work. in the logs I see this:

Unable to install package awesomelights==1.2.3: ERROR: Could not find a version that satisfies the requirement awesomelights==1.2.3 (from versions: none) ERROR: No matching distribution found for awesomelights==1.2.3 WARNING: You are using pip version 19.3; however, version 19.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
1:21 util/package.py (ERROR) - message first occurred at 1:19 and shows up 2 times
Platform error: light - Requirements for example_light not found: ['awesomelights==1.2.3'].
1:19 config.py (ERROR)
You are using a custom integration for example_light which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
1:19 loader.py (WARNING)
@skrutt
Copy link

skrutt commented Nov 21, 2019

i have the same problem

@h4de5
Copy link
Author

h4de5 commented Nov 21, 2019

@skrutt : here is a better example:
https://github.com/GeoffAtHome/lightwaverf-home-assistant-lights/blob/master/lightwave.py

in _send_reliable_message just return True, so you can run it without any of those devices.

@balloob
Copy link
Member

balloob commented Nov 21, 2019

It's using the old identifier, but it does still work. You're right that we should update these.

Your error is because you didn't update the requirements, so it is trying to install a library for awesomelights==1.2.3 which does not exist.

@rousveiga
Copy link

Is this component supposed to be runnable as an example, or is it only a template for light component development? If the former is true, what am I supposed to replace awesomelights==1.2.3 with?

@h4de5
Copy link
Author

h4de5 commented Sep 15, 2020

I think it is the later one. Any communication with the actual lights/hub/platform etc. should be outsourced to a python package on its own (like the imaginary awesomelights) leaving only the part that communicates with HA in the maintained source.

if you are looking for an example of the former one, checkout the list of light integrations: https://www.home-assistant.io/integrations/#light
e.g.: https://github.com/home-assistant/core/tree/dev/homeassistant/components/elgato

@rousveiga
Copy link

I see. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants