Add HomematicIP SMI55 device (#19400)

pull/19574/head
Mattias Welponer 2018-12-25 10:40:21 +01:00 committed by Martin Hjelmare
parent 18b7f74ad7
commit b80bed64f5
2 changed files with 8 additions and 4 deletions

View File

@ -28,14 +28,16 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the HomematicIP Cloud binary sensor from a config entry."""
from homematicip.aio.device import (
AsyncShutterContact, AsyncMotionDetectorIndoor, AsyncSmokeDetector,
AsyncWaterSensor, AsyncRotaryHandleSensor)
AsyncWaterSensor, AsyncRotaryHandleSensor,
AsyncMotionDetectorPushButton)
home = hass.data[HMIPC_DOMAIN][config_entry.data[HMIPC_HAPID]].home
devices = []
for device in home.devices:
if isinstance(device, (AsyncShutterContact, AsyncRotaryHandleSensor)):
devices.append(HomematicipShutterContact(home, device))
elif isinstance(device, AsyncMotionDetectorIndoor):
elif isinstance(device, (AsyncMotionDetectorIndoor,
AsyncMotionDetectorPushButton)):
devices.append(HomematicipMotionDetector(home, device))
elif isinstance(device, AsyncSmokeDetector):
devices.append(HomematicipSmokeDetector(home, device))

View File

@ -35,7 +35,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
from homematicip.aio.device import (
AsyncHeatingThermostat, AsyncTemperatureHumiditySensorWithoutDisplay,
AsyncTemperatureHumiditySensorDisplay, AsyncMotionDetectorIndoor,
AsyncTemperatureHumiditySensorOutdoor)
AsyncTemperatureHumiditySensorOutdoor,
AsyncMotionDetectorPushButton)
home = hass.data[HMIPC_DOMAIN][config_entry.data[HMIPC_HAPID]].home
devices = [HomematicipAccesspointStatus(home)]
@ -47,7 +48,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
AsyncTemperatureHumiditySensorOutdoor)):
devices.append(HomematicipTemperatureSensor(home, device))
devices.append(HomematicipHumiditySensor(home, device))
if isinstance(device, AsyncMotionDetectorIndoor):
if isinstance(device, (AsyncMotionDetectorIndoor,
AsyncMotionDetectorPushButton)):
devices.append(HomematicipIlluminanceSensor(home, device))
if devices: