mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix SPC (#17236)
This commit is contained in:
parent
849665b9ca
commit
a54e242245
@ -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()])
|
||||
|
@ -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()
|
||||
|
@ -63,11 +63,11 @@ async def async_setup(hass, config):
|
||||
|
||||
# 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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user