Add device_info to HomematicIP climate and acp (#27771)

This commit is contained in:
SukramJ 2019-10-18 02:25:16 +02:00 committed by Paulus Schoutsen
parent 81178661ae
commit 564789470e
2 changed files with 23 additions and 2 deletions

View File

@ -59,6 +59,17 @@ class HomematicipAlarmControlPanel(AlarmControlPanel):
else:
self._external_alarm_zone = security_zone
@property
def device_info(self):
"""Return device specific attributes."""
return {
"identifiers": {(HMIPC_DOMAIN, f"ACP {self._home.id}")},
"name": self.name,
"manufacturer": "eQ-3",
"model": CONST_ALARM_CONTROL_PANEL_NAME,
"via_device": (HMIPC_DOMAIN, self._home.id),
}
@property
def state(self) -> str:
"""Return the state of the device."""

View File

@ -56,12 +56,23 @@ class HomematicipHeatingGroup(HomematicipGenericDevice, ClimateDevice):
def __init__(self, hap: HomematicipHAP, device) -> None:
"""Initialize heating group."""
device.modelType = "Group-Heating"
device.modelType = "HmIP-Heating-Group"
self._simple_heating = None
if device.actualTemperature is None:
self._simple_heating = _get_first_heating_thermostat(device)
super().__init__(hap, device)
@property
def device_info(self):
"""Return device specific attributes."""
return {
"identifiers": {(HMIPC_DOMAIN, self._device.id)},
"name": self._device.label,
"manufacturer": "eQ-3",
"model": self._device.modelType,
"via_device": (HMIPC_DOMAIN, self._device.homeId),
}
@property
def temperature_unit(self) -> str:
"""Return the unit of measurement."""
@ -176,4 +187,3 @@ def _get_first_heating_thermostat(heating_group: AsyncHeatingGroup):
for device in heating_group.devices:
if isinstance(device, (AsyncHeatingThermostat, AsyncHeatingThermostatCompact)):
return device
return None