Add HmIP-STV to HomematicIP Cloud (#39518)

* add general attribute for connection type

* Add HmIP-STV to HomematicIP Cloud
This commit is contained in:
SukramJ authored and GitHub committed 2020-09-03 17:23:42 +02:00
1 parent 77c6a48553
commit 4dee2b599a
4 files changed
+52 -3

No files matched your search

@@ -16,6 +16,7 @@ from homematicip.aio.device import (
AsyncShutterContact,
AsyncShutterContactMagnetic,
AsyncSmokeDetector,
AsyncTiltVibrationSensor,
AsyncWaterSensor,
AsyncWeatherSensor,
AsyncWeatherSensorPlus,
@@ -85,6 +86,8 @@ async def async_setup_entry(
for device in hap.home.devices:
if isinstance(device, AsyncAccelerationSensor):
entities.append(HomematicipAccelerationSensor(hap, device))
if isinstance(device, AsyncTiltVibrationSensor):
entities.append(HomematicipTiltVibrationSensor(hap, device))
if isinstance(device, (AsyncContactInterface, AsyncFullFlushContactInterface)):
entities.append(HomematicipContactInterface(hap, device))
if isinstance(
@@ -133,8 +136,8 @@ async def async_setup_entry(
async_add_entities(entities)
class HomematicipAccelerationSensor(HomematicipGenericEntity, BinarySensorEntity):
"""Representation of the HomematicIP acceleration sensor."""
class HomematicipBaseActionSensor(HomematicipGenericEntity, BinarySensorEntity):
"""Representation of the HomematicIP base action sensor."""
@property
def device_class(self) -> str:
@@ -159,6 +162,14 @@ class HomematicipAccelerationSensor(HomematicipGenericEntity, BinarySensorEntity
return state_attr
class HomematicipAccelerationSensor(HomematicipBaseActionSensor):
"""Representation of the HomematicIP acceleration sensor."""
class HomematicipTiltVibrationSensor(HomematicipBaseActionSensor):
"""Representation of the HomematicIP tilt vibration sensor."""
class HomematicipContactInterface(HomematicipGenericEntity, BinarySensorEntity):
"""Representation of the HomematicIP contact interface."""
@@ -17,6 +17,7 @@ _LOGGER = logging.getLogger(__name__)
ATTR_MODEL_TYPE = "model_type"
ATTR_LOW_BATTERY = "low_battery"
ATTR_CONFIG_PENDING = "config_pending"
ATTR_CONNECTION_TYPE = "connection_type"
ATTR_DUTY_CYCLE_REACHED = "duty_cycle_reached"
ATTR_ID = "id"
ATTR_IS_GROUP = "is_group"
@@ -43,6 +44,7 @@ DEVICE_ATTRIBUTE_ICONS = {
DEVICE_ATTRIBUTES = {
"modelType": ATTR_MODEL_TYPE,
"connectionType": ATTR_CONNECTION_TYPE,
"sabotage": ATTR_SABOTAGE,
"dutyCycle": ATTR_DUTY_CYCLE_REACHED,
"rssiDeviceValue": ATTR_RSSI_DEVICE,