Minor updates

This commit is contained in:
Fabian Affolter 2017-04-30 23:06:50 +02:00
parent 676f426a53
commit 3bef0ad30f
No known key found for this signature in database
GPG Key ID: DDF3D6F44AAB1336
2 changed files with 4 additions and 3 deletions

View File

@ -63,13 +63,14 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
# Verify that passed in configuration works # Verify that passed in configuration works
if not hub.is_valid_login(): if not hub.is_valid_login():
_LOGGER.error('Could not connect to AwesomeLight hub') _LOGGER.error("Could not connect to AwesomeLight hub")
return False return False
# Add devices # Add devices
add_devices(AwesomeLight(light) for light in hub.lights()) add_devices(AwesomeLight(light) for light in hub.lights())
class AwesomeLight(Light): class AwesomeLight(Light):
"""Representation of an Awesome Light.""" """Representation of an Awesome Light."""
@ -87,7 +88,7 @@ class AwesomeLight(Light):
@property @property
def brightness(self): def brightness(self):
"""Brightness of the light (an integer in the range 1-255). """Return the brightness of the light.
This method is optional. Removing it indicates to Home Assistant This method is optional. Removing it indicates to Home Assistant
that brightness is not supported for this light. that brightness is not supported for this light.

View File

@ -15,7 +15,7 @@ This is a minimum implementation of a platform for the sensor component.
Copy the code below and create it as a file in `<config_dir>/custom_components/sensor/example.py`. Copy the code below and create it as a file in `<config_dir>/custom_components/sensor/example.py`.
Add the following to your configuration.yaml: Add the following to your `configuration.yaml` file:
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry