-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from loopj/more-thermostats
Add additional thermostat types to the thermostat controller
- Loading branch information
Showing
12 changed files
with
353 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
from aiovantage.objects import Thermostat | ||
from aiovantage.objects import ( | ||
Thermostat, | ||
VantageGenericHVACRS485ZoneChild, | ||
VantageGenericHVACRS485ZoneWithoutFanSpeedChild, | ||
VantageHVACIUZoneChild, | ||
VantageVirtualThermostatPort, | ||
) | ||
|
||
from .base import BaseController | ||
|
||
ThermostatTypes = ( | ||
Thermostat | ||
| VantageGenericHVACRS485ZoneChild | ||
| VantageGenericHVACRS485ZoneWithoutFanSpeedChild | ||
| VantageHVACIUZoneChild | ||
| VantageVirtualThermostatPort | ||
) | ||
"""Types managed by the thermostats controller.""" | ||
|
||
class ThermostatsController(BaseController[Thermostat]): | ||
"""Thermostats controller. | ||
|
||
Thermostats have a number of temperature sensors associated with them which | ||
represent the current indoor temperature, outdoor temperature, and the | ||
current cool and heat setpoints. | ||
""" | ||
class ThermostatsController(BaseController[ThermostatTypes]): | ||
"""Thermostats controller.""" | ||
|
||
vantage_types = ("Thermostat",) | ||
vantage_types = ( | ||
"Thermostat", | ||
"Vantage.Generic_HVAC_RS485_Zone_CHILD", | ||
"Vantage.Generic_HVAC_RS485_Zone_without_FanSpeed_CHILD", | ||
"Vantage.HVAC-IU-Zone_CHILD", | ||
"Vantage.VirtualThermostat_PORT", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
"""Vantage Generic HVAC RS485 objects.""" | ||
|
||
from dataclasses import dataclass, field | ||
|
||
from aiovantage.object_interfaces import FanInterface, ThermostatInterface | ||
|
||
from .child_device import ChildDevice | ||
from .port_device import PortDevice | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageGenericHVACRS485Port(PortDevice): | ||
"""Vantage Generic HVAC RS485 port device.""" | ||
|
||
class Meta: | ||
name = "Vantage.Generic_HVAC_RS485_PORT" | ||
|
||
@dataclass(kw_only=True) | ||
class FanSpeedSettings: | ||
auto_fan: bool = True | ||
high_fan: bool = True | ||
low_fan: bool = True | ||
max_fan: bool = True | ||
med_fan: bool = True | ||
off_fan: bool = True | ||
|
||
@dataclass(kw_only=True) | ||
class SensorSettings: | ||
no_device_sensors: bool = False | ||
outdoor_sensor: int = field(metadata={"name": "outdoorSensor"}) | ||
outdoor_temp_offset: str = field( | ||
default="0", metadata={"name": "outdoorTempOffset"} | ||
) | ||
track_sensors: bool = False | ||
|
||
@dataclass(kw_only=True) | ||
class SetpointSettings: | ||
bind_setpoints: bool = False | ||
max_temp: int = 25 | ||
min_temp: int = 15 | ||
|
||
fan_boost_option: bool = False | ||
fan_speed_settings: FanSpeedSettings | ||
fan_individual_control: bool = False | ||
receive_port: int | ||
sensor_settings: SensorSettings | ||
setpoint_settings: SetpointSettings | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageGenericHVACRS485TechContactsChild(ChildDevice): | ||
"""Vantage Generic HVAC RS485 tech contacts child device.""" | ||
|
||
class Meta: | ||
name = "Vantage.Generic_HVAC_RS485_TechContacts_CHILD" | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageGenericHVACRS485CompoundChild(ChildDevice, ThermostatInterface): | ||
"""Vantage Generic HVAC RS485 compound child device.""" | ||
|
||
class Meta: | ||
name = "Vantage.Generic_HVAC_RS485_Compound_CHILD" | ||
|
||
adress_number: int = 1 # NOTE: Intentional typo to match the underlying object | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageGenericHVACRS485ZoneChild(ChildDevice, ThermostatInterface, FanInterface): | ||
"""Vantage Generic HVAC RS485 zone child device.""" | ||
|
||
class Meta: | ||
name = "Vantage.Generic_HVAC_RS485_Zone_CHILD" | ||
|
||
@dataclass(kw_only=True) | ||
class IndoorSettings: | ||
indoor_sensor: int = field(metadata={"name": "indoorSensor"}) | ||
indoor_temp_offset: str = "0" | ||
|
||
indoor_settings: IndoorSettings | ||
position_number: int = 1 | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageGenericHVACRS485ZoneWithoutFanSpeedChild( | ||
ChildDevice, ThermostatInterface, FanInterface | ||
): | ||
"""Vantage Generic HVAC RS485 zone child device without fan speed.""" | ||
|
||
class Meta: | ||
name = "Vantage.Generic_HVAC_RS485_Zone_without_FanSpeed_CHILD" | ||
|
||
@dataclass(kw_only=True) | ||
class IndoorSettings: | ||
indoor_sensor: int = field(metadata={"name": "indoorSensor"}) | ||
indoor_temp_offset: str = "0" | ||
|
||
indoor_settings: IndoorSettings | ||
position_number: int = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
"""Vantage HVAC-IU objects.""" | ||
|
||
from dataclasses import dataclass, field | ||
|
||
from aiovantage.object_interfaces import FanInterface, ThermostatInterface | ||
|
||
from .child_device import ChildDevice | ||
from .port_device import PortDevice | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageHVACIUPort(PortDevice): | ||
"""Vantage HVAC-IU port device.""" | ||
|
||
class Meta: | ||
name = "Vantage.HVAC-IU_PORT" | ||
|
||
temperature_format: str = field( | ||
default="Celcius", # NOTE: Intentional typo to match the underlying object | ||
metadata={"name": "aTemperatureFormat"}, | ||
) | ||
outdoor_sensor: int | ||
pauze_time: int = 1 # NOTE: Intentional typo to match the underlying object | ||
serial_number: str = "0" | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageHVACIULineChild(ChildDevice): | ||
"""Vantage HVAC-IU line child device.""" | ||
|
||
class Meta: | ||
name = "Vantage.HVAC-IU-Line_CHILD" | ||
|
||
@dataclass(kw_only=True) | ||
class OperationModes: | ||
auto: bool = True | ||
cool: bool = True | ||
heat: bool = True | ||
|
||
@dataclass(kw_only=True) | ||
class FanSpeeds: | ||
auto: bool = True | ||
high: bool = True | ||
low: bool = True | ||
max: bool = True | ||
med: bool = True | ||
|
||
device_type: str = "Daikin" | ||
line_number: int = 1 | ||
operation_modes: OperationModes | ||
fan_speeds: FanSpeeds = field(metadata={"name": "xFanSpeeds"}) | ||
|
||
|
||
@dataclass(kw_only=True) | ||
class VantageHVACIUZoneChild(ChildDevice, ThermostatInterface, FanInterface): | ||
"""Vantage HVAC-IU zone child device.""" | ||
|
||
class Meta: | ||
name = "Vantage.HVAC-IU-Zone_CHILD" | ||
|
||
@dataclass(kw_only=True) | ||
class IndoorSensor: | ||
indoor_sensor: int | ||
indoor_temp_offset: str = "0" | ||
|
||
main_zone: str = field( | ||
metadata={"name": "ZoneNumber", "wrapper": "aMainZonePlaceHolder"} | ||
) | ||
|
||
grouped_zones: list[str] = field( | ||
default_factory=list, | ||
metadata={"name": "ZoneNumberChild", "wrapper": "bGroupZonePlaceHolder"}, | ||
) | ||
|
||
indoor_sensors: list[IndoorSensor] = field( | ||
default_factory=list, metadata={"name": "cIndoorSensors"} | ||
) |
Oops, something went wrong.