-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
MagicLight/Flux WiFi Color LED Light Component #2534
Conversation
6cf1a8e
to
ce22921
Compare
self._bulb = flux_led.WifiLedBulb(ipaddr) | ||
except socket.error: | ||
self.is_valid = False | ||
_LOGGER.error("Failed to connect to bulb %s, %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 62: W291 trailing whitespace
ce22921
to
e8856bf
Compare
Automatic detection of my WiFi LED CONTROLLER works. On/off and interfering with the MagicHome app works too. |
from homeassistant.components.light import Light | ||
import homeassistant.helpers.config_validation as cv | ||
|
||
REQUIREMENTS = ['https://github.com/Danielhiversen/flux_led/archive/0.3.zip'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The traceback I got:
16-07-17 15:49:56 INFO (MainThread) [homeassistant.loader] Loaded light.flux_led from homeassistant.components.light.flux_led
Traceback (most recent call last):
File "/home/fab/Documents/repos/home-assistant/homeassistant/util/package.py", line 46, in check_package_exists
req = pkg_resources.Requirement.parse(package)
[...]
File "/home/fab/Documents/repos/home-assistant/homeassistant/util/package.py", line 49, in check_package_exists
req = pkg_resources.Requirement.parse(urlparse(package).fragment)
File "/home/fab/Documents/repos/home-assistant/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 3047, in parse
req, = parse_requirements(s)
ValueError: need more than 0 values to unpack
I guess that it could be fixed by changing the REQUIREMENTS
(untested) -> REQUIREMENTS = ['https://github.com/Danielhiversen/flux_led/archive/0.3.zip#flux_led==0.3']
e8856bf
to
7aa3fd9
Compare
Thanks for your feedback. |
@balloob Could you have a look at this? |
|
||
PLATFORM_SCHEMA = vol.Schema({ | ||
vol.Required("platform"): DOMAIN, | ||
vol.Optional('devices', default={}): vol.All(dict, _valid_lights), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of vol.All(dict, _valid_lights)
you can use:
{cv.string: DEVICE_SCHEMA}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should this be required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be required.
You do not have to specify any devices/lights.
3d7f5f9
to
25e2f36
Compare
I think this is ready for a new review. |
Looks good! 🐬 |
Description:
https://community.home-assistant.io/t/magiclight-flux-wifi-color-led-light-component/2271
Many thanks to mplawner and @tchellomello for helping me with testing
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#649
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If code communicates with devices, web services, or a:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass