diff --git a/homeassistant/components/discovery.py b/homeassistant/components/discovery.py index efa3aa47cbf..c9f770dc4ea 100644 --- a/homeassistant/components/discovery.py +++ b/homeassistant/components/discovery.py @@ -1,10 +1,10 @@ """ Starts a service to scan in intervals for new devices. -Will emit EVENT_SERVICE_DISCOVERED whenever a new service has been discovered. +Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are -loaded before the EVENT_SERVICE_DISCOVERED is fired. +loaded before the EVENT_PLATFORM_DISCOVERED is fired. """ import logging @@ -16,7 +16,7 @@ import homeassistant.external.netdisco.netdisco.const as services from homeassistant import bootstrap from homeassistant.const import ( - EVENT_HOMEASSISTANT_START, EVENT_SERVICE_DISCOVERED, + EVENT_HOMEASSISTANT_START, EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED) DOMAIN = "discovery" @@ -47,7 +47,7 @@ def listen(hass, service, callback): if event.data[ATTR_SERVICE] in service: callback(event.data[ATTR_SERVICE], event.data[ATTR_DISCOVERED]) - hass.bus.listen(EVENT_SERVICE_DISCOVERED, discovery_event_listener) + hass.bus.listen(EVENT_PLATFORM_DISCOVERED, discovery_event_listener) def setup(hass, config): @@ -71,7 +71,7 @@ def setup(hass, config): if bootstrap.setup_component(hass, component, config): hass.pool.add_worker() - hass.bus.fire(EVENT_SERVICE_DISCOVERED, { + hass.bus.fire(EVENT_PLATFORM_DISCOVERED, { ATTR_SERVICE: service, ATTR_DISCOVERED: info }) diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index dd7f5e35942..ab660281e0e 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -10,7 +10,8 @@ from homeassistant import bootstrap from homeassistant.loader import get_component from homeassistant.helpers import validate_config from homeassistant.const import ( - EVENT_SERVICE_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED, CONF_ACCESS_TOKEN) + EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED, + CONF_ACCESS_TOKEN) DOMAIN = "wink" DEPENDENCIES = [] @@ -43,7 +44,7 @@ def setup(hass, config): hass.pool.add_worker() # Fire discovery event - hass.bus.fire(EVENT_SERVICE_DISCOVERED, { + hass.bus.fire(EVENT_PLATFORM_DISCOVERED, { ATTR_SERVICE: discovery_type, ATTR_DISCOVERED: {} }) diff --git a/homeassistant/const.py b/homeassistant/const.py index 06b5ce8428e..39089ae84cb 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -27,7 +27,7 @@ EVENT_STATE_CHANGED = "state_changed" EVENT_TIME_CHANGED = "time_changed" EVENT_CALL_SERVICE = "call_service" EVENT_SERVICE_EXECUTED = "service_executed" -EVENT_SERVICE_DISCOVERED = "service_discovered" +EVENT_PLATFORM_DISCOVERED = "platform_discovered" # #### STATES #### STATE_ON = 'on'