diff --git a/atom.xml b/atom.xml index dbf6b5b4d4..66f52067e5 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/announcements/atom.xml b/blog/categories/announcements/atom.xml index 017b2929ff..8c093f5398 100644 --- a/blog/categories/announcements/atom.xml +++ b/blog/categories/announcements/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Announcements | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/community/atom.xml b/blog/categories/community/atom.xml index 68764fcc9e..32de11b021 100644 --- a/blog/categories/community/atom.xml +++ b/blog/categories/community/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Community | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/device-tracking/atom.xml b/blog/categories/device-tracking/atom.xml index baeb249e60..f4439c09f0 100644 --- a/blog/categories/device-tracking/atom.xml +++ b/blog/categories/device-tracking/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Device-Tracking | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/esp8266/atom.xml b/blog/categories/esp8266/atom.xml index 70a04e7897..104de768e8 100644 --- a/blog/categories/esp8266/atom.xml +++ b/blog/categories/esp8266/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: ESP8266 | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/how-to/atom.xml b/blog/categories/how-to/atom.xml index defcce92d0..1ede114202 100644 --- a/blog/categories/how-to/atom.xml +++ b/blog/categories/how-to/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: How-To | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/ibeacons/atom.xml b/blog/categories/ibeacons/atom.xml index 9b556ef84d..6343000f04 100644 --- a/blog/categories/ibeacons/atom.xml +++ b/blog/categories/ibeacons/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: iBeacons | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/internet-of-things/atom.xml b/blog/categories/internet-of-things/atom.xml index 1a8d15f1ed..27b69bd6be 100644 --- a/blog/categories/internet-of-things/atom.xml +++ b/blog/categories/internet-of-things/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Internet-of-Things | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/iot-data/atom.xml b/blog/categories/iot-data/atom.xml index 273f39be61..8b4f4fe71c 100644 --- a/blog/categories/iot-data/atom.xml +++ b/blog/categories/iot-data/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: IoT-Data | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/media/atom.xml b/blog/categories/media/atom.xml index 883f151c92..35f9bd48a8 100644 --- a/blog/categories/media/atom.xml +++ b/blog/categories/media/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Media | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/merchandise/atom.xml b/blog/categories/merchandise/atom.xml index bb5ec5ad84..f4400211b9 100644 --- a/blog/categories/merchandise/atom.xml +++ b/blog/categories/merchandise/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Merchandise | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/micropython/atom.xml b/blog/categories/micropython/atom.xml index fb3d0f4f1c..a1e8432678 100644 --- a/blog/categories/micropython/atom.xml +++ b/blog/categories/micropython/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Micropython | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/mqtt/atom.xml b/blog/categories/mqtt/atom.xml index e9995f462f..b755729efd 100644 --- a/blog/categories/mqtt/atom.xml +++ b/blog/categories/mqtt/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: MQTT | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/organisation/atom.xml b/blog/categories/organisation/atom.xml index 2247f027a9..6a444e2eb3 100644 --- a/blog/categories/organisation/atom.xml +++ b/blog/categories/organisation/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Organisation | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/owntracks/atom.xml b/blog/categories/owntracks/atom.xml index 19475bc724..2cdda53500 100644 --- a/blog/categories/owntracks/atom.xml +++ b/blog/categories/owntracks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: OwnTracks | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/presence-detection/atom.xml b/blog/categories/presence-detection/atom.xml index ffebc42960..43fb4559b1 100644 --- a/blog/categories/presence-detection/atom.xml +++ b/blog/categories/presence-detection/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Presence-Detection | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/public-service-announcement/atom.xml b/blog/categories/public-service-announcement/atom.xml index 152e73c39a..6162fb50f6 100644 --- a/blog/categories/public-service-announcement/atom.xml +++ b/blog/categories/public-service-announcement/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Public-Service-Announcement | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index 3bfbd3d5c5..2b94cc422c 100644 --- a/blog/categories/release-notes/atom.xml +++ b/blog/categories/release-notes/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Release-Notes | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/survey/atom.xml b/blog/categories/survey/atom.xml index a9fee10213..f844d856d3 100644 --- a/blog/categories/survey/atom.xml +++ b/blog/categories/survey/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Survey | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/talks/atom.xml b/blog/categories/talks/atom.xml index 29e306c9ed..05b6ee6ee3 100644 --- a/blog/categories/talks/atom.xml +++ b/blog/categories/talks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Talks | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/technology/atom.xml b/blog/categories/technology/atom.xml index 63e47e2023..48165e7652 100644 --- a/blog/categories/technology/atom.xml +++ b/blog/categories/technology/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Technology | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/user-stories/atom.xml b/blog/categories/user-stories/atom.xml index d226b61e1d..26f90d3036 100644 --- a/blog/categories/user-stories/atom.xml +++ b/blog/categories/user-stories/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: User-Stories | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/video/atom.xml b/blog/categories/video/atom.xml index e4a920612a..b9f18caf69 100644 --- a/blog/categories/video/atom.xml +++ b/blog/categories/video/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Video | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/blog/categories/website/atom.xml b/blog/categories/website/atom.xml index d1b4b2f597..62e425cef4 100644 --- a/blog/categories/website/atom.xml +++ b/blog/categories/website/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Website | Home Assistant]]> - 2017-12-04T04:48:54+00:00 + 2017-12-04T06:51:23+00:00 https://home-assistant.io/ diff --git a/developers/component_discovery/index.html b/developers/component_discovery/index.html index 6997bbe8cd..73dba32513 100644 --- a/developers/component_discovery/index.html +++ b/developers/component_discovery/index.html @@ -82,22 +82,35 @@ This option is only available for built-in components.

Device discovery for Home Assistant has been extracted into an external library called NetDisco. This library is integrated using the discovery component and scans the network in intervals for uPnP and zeroconf/mDNS services.

To have your device be discovered, you will have to extend the NetDisco library to be able to find your device. This is done by adding a new discoverable. See the repository for examples of existing discoverable.

Listening to SERVICE_DISCOVERED events

-

From your component, you will have to set up the listening for specific services. Given below is an example how one would listen for discovered Chromecasts:

-
from homeassistant.loader import get_component
+

From your component, you will have to set up the listening for specific services. Given below is an example how one would listen for a discovered AwesomeDevice:

+
from homeassistant.components.discovery import SERVICE_AWESOMEDEVICE
+from homeassistant.helpers import discovery
+
+DOMAIN = 'awesomedevice'
+
+DEPENDENCIES = ['http']
 
 def setup(hass, config):
-    discovery = get_component('discovery')
+    cfg = config.get(DOMAIN)
 
-    def chromecast_discovered(service, info):
-        """ Called when a Chromecast has been discovered. """
-        print("Discovered a new Chromecast: {}".format(info))
+    def device_discovered(service, info):
+        """ Called when a Awesome device has been discovered. """
+        print("Discovered a new Awesome device: {}".format(info))
 
     discovery.listen(
-        hass, discovery.services.GOOGLE_CAST, chromecast_discovered)
+        hass, SERVICE_AWESOMEDEVICE, device_discovered)
+
+    return True
 

Auto-loading your component upon discovery

-

The Discovery component is capable of setting up your components before firing the SERVICE_DISCOVERD event. To do this you will have to update the SERVICE_HANDLERS constant in the discovery component.

+

The discovery component is capable of setting up your components before firing the EVENT_PLATFORM_DISCOVERED event. To do this you will have to update the SERVICE_HANDLERS constant in the discovery component:

+

```python +SERVICE_AWESOMEDEVICE = ‘awesomedevice’

+

SERVICE_HANDLERS = { + … + SERVICE_AWESOMEDEVICE: (‘awesomedevice’, None), +}