Skip to content

Commit bbd7c8b

Browse files
authored
Merge pull request #5 from Sander0542/feature/outdoor-temperature
feature: ATA Device outdoor temperature
2 parents 192d68d + a7aaf16 commit bbd7c8b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ one has the time to go through the source.
5454

5555
### Air-to-air heat pump properties
5656
* `room_temperature`
57+
* `outdoor_temperature`
5758
* `target_temperature`
5859
* `target_temperature_step`
5960
* `target_temperature_min`

src/pymelcloud/ata_device.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,23 @@ def room_temperature(self) -> Optional[float]:
207207
return None
208208
return self._state.get("RoomTemperature")
209209

210+
@property
211+
def has_outdoor_temperature(self) -> bool:
212+
"""Return True if the device has an outdoor temperature sensor."""
213+
if self._device_conf.get("HideOutdoorTemperature", False):
214+
return False
215+
return self._device_conf.get("Device", {}).get("HasOutdoorTemperature", False):
216+
217+
@property
218+
def outdoor_temperature(self) -> Optional[float]:
219+
"""Return outdoor temperature reported by the device."""
220+
if self._device_conf.get("HideOutdoorTemperature", False):
221+
return None
222+
device = self._device_conf.get("Device", {})
223+
if not device.get("HasOutdoorTemperature", False):
224+
return None
225+
return device.get("OutdoorTemperature")
226+
210227
@property
211228
def target_temperature(self) -> Optional[float]:
212229
"""Return target temperature set for the device."""

0 commit comments

Comments
 (0)