Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SPC #17236

Merged
merged 1 commit into from
Oct 8, 2018
Merged

Fix SPC #17236

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/alarm_control_panel/spc.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def _get_alarm_state(area):
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the SPC alarm control panel platform."""
if discovery_info is None:
return
api = hass.data[DATA_API]
async_add_entities([SpcAlarm(area=area, api=api)
for area in api.areas.values()])
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/binary_sensor/spc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def _get_device_class(zone_type):
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the SPC binary sensor."""
if discovery_info is None:
return
api = hass.data[DATA_API]
async_add_entities([SpcBinarySensor(zone)
for zone in api.zones.values()
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/spc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ async def async_upate_callback(spc_object):

# add sensor devices for each zone (typically motion/fire/door sensors)
hass.async_create_task(discovery.async_load_platform(
hass, 'binary_sensor', DOMAIN))
hass, 'binary_sensor', DOMAIN, {}))

# create a separate alarm panel for each area
hass.async_create_task(discovery.async_load_platform(
hass, 'alarm_control_panel', DOMAIN))
hass, 'alarm_control_panel', DOMAIN, {}))

# start listening for incoming events over websocket
spc.start()
Expand Down