Add homematicip cloud temperature sensor from thermostats (#23263)

pull/23306/head
Markus Jankowski 2019-04-22 09:30:49 +02:00 committed by Martin Hjelmare
parent 3b0660ae89
commit 357631d659
1 changed files with 8 additions and 12 deletions

View File

@ -38,6 +38,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if isinstance(device, (AsyncHeatingThermostat,
AsyncHeatingThermostatCompact)):
devices.append(HomematicipHeatingThermostat(home, device))
devices.append(HomematicipTemperatureSensor(home, device))
if isinstance(device, (AsyncTemperatureHumiditySensorDisplay,
AsyncTemperatureHumiditySensorWithoutDisplay,
AsyncTemperatureHumiditySensorOutdoor,
@ -46,15 +47,13 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
AsyncWeatherSensorPro)):
devices.append(HomematicipTemperatureSensor(home, device))
devices.append(HomematicipHumiditySensor(home, device))
if isinstance(device, (AsyncMotionDetectorIndoor,
if isinstance(device, (AsyncLightSensor, AsyncMotionDetectorIndoor,
AsyncMotionDetectorOutdoor,
AsyncMotionDetectorPushButton,
AsyncWeatherSensor,
AsyncWeatherSensorPlus,
AsyncWeatherSensorPro)):
devices.append(HomematicipIlluminanceSensor(home, device))
if isinstance(device, AsyncLightSensor):
devices.append(HomematicipLightSensor(home, device))
if isinstance(device, (AsyncPlugableSwitchMeasuring,
AsyncBrandSwitchMeasuring,
AsyncFullFlushSwitchMeasuring)):
@ -181,6 +180,9 @@ class HomematicipTemperatureSensor(HomematicipGenericDevice):
@property
def state(self):
"""Return the state."""
if hasattr(self._device, 'valveActualTemperature'):
return self._device.valveActualTemperature
return self._device.actualTemperature
@property
@ -213,6 +215,9 @@ class HomematicipIlluminanceSensor(HomematicipGenericDevice):
@property
def state(self):
"""Return the state."""
if hasattr(self._device, 'averageIllumination'):
return self._device.averageIllumination
return self._device.illumination
@property
@ -221,15 +226,6 @@ class HomematicipIlluminanceSensor(HomematicipGenericDevice):
return 'lx'
class HomematicipLightSensor(HomematicipIlluminanceSensor):
"""Represenation of a HomematicIP Illuminance device."""
@property
def state(self):
"""Return the state."""
return self._device.averageIllumination
class HomematicipPowerSensor(HomematicipGenericDevice):
"""Represenation of a HomematicIP power measuring device."""