mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Fix link (#6219)
This commit is contained in:
parent
c5a8372f13
commit
a80fd2f243
@ -2,9 +2,7 @@
|
||||
Support for Yeelight Sunflower color bulbs (not Yeelight Blue or WiFi).
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/light.yeelight-sunflower
|
||||
Uses the yeelightsunflower library:
|
||||
https://github.com/lindsaymarkward/python-yeelight-sunflower
|
||||
https://home-assistant.io/components/light.yeelightsunflower
|
||||
"""
|
||||
import logging
|
||||
import voluptuous as vol
|
||||
@ -18,33 +16,28 @@ from homeassistant.const import CONF_HOST
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
REQUIREMENTS = ['yeelightsunflower==0.0.6']
|
||||
SUPPORT_YEELIGHT_SUNFLOWER = (SUPPORT_BRIGHTNESS | SUPPORT_RGB_COLOR)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# Validate the user's configuration
|
||||
|
||||
SUPPORT_YEELIGHT_SUNFLOWER = (SUPPORT_BRIGHTNESS | SUPPORT_RGB_COLOR)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_HOST): cv.string
|
||||
})
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the Yeelight Sunflower Light platform."""
|
||||
"""Set up the Yeelight Sunflower Light platform."""
|
||||
import yeelightsunflower
|
||||
|
||||
# Assign configuration variables.
|
||||
# The configuration check takes care they are present.
|
||||
host = config.get(CONF_HOST)
|
||||
|
||||
# Setup connection with Yeelight Sunflower hub
|
||||
hub = yeelightsunflower.Hub(host)
|
||||
|
||||
# Verify that hub is responsive
|
||||
if not hub.available:
|
||||
_LOGGER.error('Could not connect to Yeelight Sunflower hub')
|
||||
return False
|
||||
|
||||
# Add devices
|
||||
add_devices(SunflowerBulb(light) for light in hub.get_lights())
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
Sensor for Fedex packages.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.usps/
|
||||
https://home-assistant.io/components/sensor.fedex/
|
||||
"""
|
||||
from collections import defaultdict
|
||||
import logging
|
||||
|
@ -2,7 +2,7 @@
|
||||
Sensor for UPS packages.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.usps/
|
||||
https://home-assistant.io/components/sensor.ups/
|
||||
"""
|
||||
from collections import defaultdict
|
||||
import logging
|
||||
|
Loading…
x
Reference in New Issue
Block a user