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