Skip to content

Commit

Permalink
fix autodiscovery
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli committed Jun 25, 2016
1 parent 87c138c commit 86ccf26
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions homeassistant/components/binary_sensor/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

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)
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
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
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/light/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

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)
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/rollershutter/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

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)
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/sensor/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

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)
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/switch/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

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)
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/thermostat/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

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)
Expand Down

0 comments on commit 86ccf26

Please sign in to comment.