fix autodiscovery
parent
87c138c559
commit
86ccf26a1a
|
@ -55,6 +55,8 @@ SUPPORT_HM_EVENT_AS_BINMOD = [
|
|||
|
||||
def setup_platform(hass, config, add_callback_devices, discovery_info=None):
|
||||
"""Setup the platform."""
|
||||
if discovery_info:
|
||||
config = discovery_info
|
||||
return homematic.setup_hmdevice_entity_helper(HMBinarySensor,
|
||||
config,
|
||||
add_callback_devices)
|
||||
|
|
|
@ -21,7 +21,6 @@ from homeassistant.const import EVENT_HOMEASSISTANT_STOP, \
|
|||
ATTR_SERVICE, \
|
||||
ATTR_DISCOVERED, \
|
||||
STATE_UNKNOWN
|
||||
from homeassistant.loader import get_component
|
||||
from homeassistant.helpers import discovery
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.bootstrap
|
||||
|
@ -150,10 +149,8 @@ def system_callback_handler(hass, config, src, *args):
|
|||
# When devices of this type are found
|
||||
# they are setup in HA and an event is fired
|
||||
if found_devices:
|
||||
component = get_component(component_name)
|
||||
|
||||
# HA discovery event
|
||||
discovery.load_platform(hass, component, DOMAIN, {
|
||||
discovery.load_platform(hass, component_name, DOMAIN, {
|
||||
ATTR_DISCOVER_DEVICES: found_devices
|
||||
}, config)
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ DEPENDENCIES = ['homematic']
|
|||
|
||||
def setup_platform(hass, config, add_callback_devices, discovery_info=None):
|
||||
"""Setup the platform."""
|
||||
if discovery_info:
|
||||
config = discovery_info
|
||||
return homematic.setup_hmdevice_entity_helper(HMLight,
|
||||
config,
|
||||
add_callback_devices)
|
||||
|
|
|
@ -29,6 +29,8 @@ DEPENDENCIES = ['homematic']
|
|||
|
||||
def setup_platform(hass, config, add_callback_devices, discovery_info=None):
|
||||
"""Setup the platform."""
|
||||
if discovery_info:
|
||||
config = discovery_info
|
||||
return homematic.setup_hmdevice_entity_helper(HMRollershutter,
|
||||
config,
|
||||
add_callback_devices)
|
||||
|
|
|
@ -41,6 +41,8 @@ HM_UNIT_HA_CAST = {
|
|||
|
||||
def setup_platform(hass, config, add_callback_devices, discovery_info=None):
|
||||
"""Setup the platform."""
|
||||
if discovery_info:
|
||||
config = discovery_info
|
||||
return homematic.setup_hmdevice_entity_helper(HMSensor,
|
||||
config,
|
||||
add_callback_devices)
|
||||
|
|
|
@ -28,6 +28,8 @@ DEPENDENCIES = ['homematic']
|
|||
|
||||
def setup_platform(hass, config, add_callback_devices, discovery_info=None):
|
||||
"""Setup the platform."""
|
||||
if discovery_info:
|
||||
config = discovery_info
|
||||
return homematic.setup_hmdevice_entity_helper(HMSwitch,
|
||||
config,
|
||||
add_callback_devices)
|
||||
|
|
|
@ -28,6 +28,8 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
def setup_platform(hass, config, add_callback_devices, discovery_info=None):
|
||||
"""Setup the platform."""
|
||||
if discovery_info:
|
||||
config = discovery_info
|
||||
return homematic.setup_hmdevice_entity_helper(HMThermostat,
|
||||
config,
|
||||
add_callback_devices)
|
||||
|
|
Loading…
Reference in New Issue