2024-05-02 13:05:26 +00:00
|
|
|
"""Frost protection module."""
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from ..smartmodule import SmartModule
|
|
|
|
|
|
|
|
|
2024-05-11 18:28:18 +00:00
|
|
|
class FrostProtection(SmartModule):
|
2024-05-02 13:05:26 +00:00
|
|
|
"""Implementation for frost protection module.
|
|
|
|
|
|
|
|
This basically turns the thermostat on and off.
|
|
|
|
"""
|
|
|
|
|
|
|
|
REQUIRED_COMPONENT = "frost_protection"
|
|
|
|
QUERY_GETTER_NAME = "get_frost_protection"
|
|
|
|
|
2024-07-04 07:02:50 +00:00
|
|
|
def query(self) -> dict:
|
|
|
|
"""Query to execute during the update cycle."""
|
|
|
|
return {}
|
|
|
|
|
2024-05-02 13:05:26 +00:00
|
|
|
@property
|
|
|
|
def enabled(self) -> bool:
|
|
|
|
"""Return True if frost protection is on."""
|
|
|
|
return self._device.sys_info["frost_protection_on"]
|
|
|
|
|
2024-11-10 18:55:13 +00:00
|
|
|
async def set_enabled(self, enable: bool) -> dict:
|
2024-05-02 13:05:26 +00:00
|
|
|
"""Enable/disable frost protection."""
|
|
|
|
return await self.call(
|
|
|
|
"set_device_info",
|
|
|
|
{"frost_protection_on": enable},
|
|
|
|
)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def minimum_temperature(self) -> int:
|
|
|
|
"""Return frost protection minimum temperature."""
|
|
|
|
return self.data["min_temp"]
|
|
|
|
|
|
|
|
@property
|
|
|
|
def temperature_unit(self) -> str:
|
|
|
|
"""Return frost protection temperature unit."""
|
|
|
|
return self.data["temp_unit"]
|