diff --git a/atom.xml b/atom.xml index 0e20c4083d..87a1014af1 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
name
allows multiple notifiers to be created. The default value is notify
. The notifier will bind to the service notify.NOTIFIER_NAME
.Details for the (API)[https://www.notifymyandroid.com/api.jsp].
+Details for the API.
To use notifications, please see the getting started with automation page.
diff --git a/developers/platform_example_light/index.html b/developers/platform_example_light/index.html index 5871d61e45..e99790b263 100644 --- a/developers/platform_example_light/index.html +++ b/developers/platform_example_light/index.html @@ -91,7 +91,7 @@This example is for adding support for the imaginary Awesome Lights. It shows the different best practices for developing a platform.
-Similar to Example Sensor Platform, Copy the code below and create it as a file in <config_dir>/custom_components/light/awesomelights.py
.
Similar to Example Sensor Platform, copy the code below, and create it as a file in <config_dir>/custom_components/light/awesomelights.py
.
Add the following to your configuration.yaml:
@@ -107,34 +107,40 @@import logging
+import voluptuous as vol
+
# Import the device class from the component that you want to support
-from homeassistant.components.light import ATTR_BRIGHTNESS, Light
+from homeassistant.components.light import ATTR_BRIGHTNESS, Light, PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
+import homeassistant.helpers.config_validation as cv
# Home Assistant depends on 3rd party packages for API specific code.
REQUIREMENTS = ['awesome_lights==1.2.3']
_LOGGER = logging.getLogger(__name__)
+# Validation of the user's configuration
+PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
+ vol.Required(CONF_HOST): cv.string,
+ vol.Optional(CONF_USERNAME, default='admin'): cv.string,
+ vol.Optional(CONF_PASSWORD): cv.string,
+})
+
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the Awesome Light platform."""
import awesomelights
- # Validate passed in config
+ # Assign configuration variables. The configuration check takes care they are
+ # present.
host = config.get(CONF_HOST)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
- if host is None or username is None or password is None:
- _LOGGER.error('Invalid config. Expected %s, %s and %s',
- CONF_HOST, CONF_USERNAME, CONF_PASSWORD)
- return False
-
# Setup connection with devices/cloud
hub = awesomelights.Hub(host, username, password)
- # Verify that passed in config works
+ # Verify that passed in configuration works
if not hub.is_valid_login():
_LOGGER.error('Could not connect to AwesomeLight hub')
return False
diff --git a/sitemap.xml b/sitemap.xml
index 2717652623..f679cc10ad 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1980,62 +1980,62 @@
https://home-assistant.io/demo/frontend.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/index.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-event.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-info.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-service.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-state.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-template.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-history.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-iframe.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-logbook.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/demo/panels/ha-panel-map.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/googlef4f3693c209fe788.html
-2016-09-06T14:35:06+00:00
+2016-09-07T07:07:08+00:00
https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html
-2016-09-06T14:35:07+00:00
+2016-09-07T07:07:09+00:00
https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html
-2016-09-06T14:35:07+00:00
+2016-09-07T07:07:09+00:00
https://home-assistant.io/static/mdi-demo.html
-2016-09-06T14:35:07+00:00
+2016-09-07T07:07:09+00:00