|
20 | 20 | DOMAIN_OBJECTS, |
21 | 21 | LOCATIONS, |
22 | 22 | LOGGER, |
23 | | - MAX_SETPOINT, |
24 | | - MIN_SETPOINT, |
25 | 23 | MODULES, |
26 | 24 | NOTIFICATIONS, |
27 | 25 | RULES, |
|
30 | 28 | SWITCH_GROUP_TYPES, |
31 | 29 | SYSTEM, |
32 | 30 | ZONE_THERMOSTATS, |
33 | | - ActuatorData, |
34 | 31 | ApplianceData, |
35 | 32 | DeviceData, |
36 | 33 | GatewayData, |
@@ -60,37 +57,6 @@ def update_for_cooling(self, devices: dict[str, DeviceData]) -> None: |
60 | 57 | if self._elga_cooling_active or self._lortherm_cooling_active: |
61 | 58 | device["binary_sensors"]["cooling_state"] = True |
62 | 59 |
|
63 | | - # Add setpoint_low and setpoint_high when cooling is enabled |
64 | | - if device["dev_class"] not in ZONE_THERMOSTATS: |
65 | | - continue |
66 | | - |
67 | | - if self._elga_cooling_enabled: |
68 | | - # Replace setpoint with setpoint_high/_low |
69 | | - thermostat = device["thermostat"] |
70 | | - sensors = device["sensors"] |
71 | | - max_setpoint = MAX_SETPOINT |
72 | | - min_setpoint = MIN_SETPOINT |
73 | | - if self._sched_setpoints is not None: |
74 | | - max_setpoint = self._sched_setpoints[1] |
75 | | - min_setpoint = self._sched_setpoints[0] |
76 | | - |
77 | | - temp_dict: ActuatorData = { |
78 | | - "setpoint_low": thermostat["setpoint"], |
79 | | - "setpoint_high": max_setpoint, |
80 | | - } |
81 | | - if self._elga_cooling_active: |
82 | | - temp_dict = { |
83 | | - "setpoint_low": min_setpoint, |
84 | | - "setpoint_high": thermostat["setpoint"], |
85 | | - } |
86 | | - if "setpoint" in sensors: |
87 | | - sensors.pop("setpoint") |
88 | | - sensors["setpoint_low"] = temp_dict["setpoint_low"] |
89 | | - sensors["setpoint_high"] = temp_dict["setpoint_high"] |
90 | | - thermostat.pop("setpoint") |
91 | | - temp_dict.update(thermostat) |
92 | | - device["thermostat"] = temp_dict |
93 | | - |
94 | 60 | # For Adam + on/off cooling, modify heating_state and cooling_state |
95 | 61 | # based on provided info by Plugwise |
96 | 62 | if ( |
@@ -656,28 +622,11 @@ async def set_preset(self, loc_id: str, preset: str) -> None: |
656 | 622 |
|
657 | 623 | await self._request(uri, method="put", data=data) |
658 | 624 |
|
659 | | - async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None: |
| 625 | + async def set_temperature(self, loc_id: str, temperature: float) -> None: |
660 | 626 | """Set the given Temperature on the relevant Thermostat.""" |
661 | | - setpoint: float | None = None |
662 | | - if "setpoint" in items: |
663 | | - setpoint = items["setpoint"] |
664 | | - if self._elga_cooling_enabled: |
665 | | - if "setpoint_low" in items: |
666 | | - setpoint = items["setpoint_low"] |
667 | | - if self._elga_cooling_active: |
668 | | - if "setpoint_high" in items: |
669 | | - setpoint = items["setpoint_high"] |
670 | | - |
671 | | - if setpoint is None: |
672 | | - raise PlugwiseError( |
673 | | - "Plugwise: failed setting temperature: no valid input provided" |
674 | | - ) # pragma: no cover |
675 | | - temperature = str(setpoint) |
| 627 | + temp = str(temperature) |
676 | 628 | uri = self._thermostat_uri(loc_id) |
677 | | - data = ( |
678 | | - "<thermostat_functionality><setpoint>" |
679 | | - f"{temperature}</setpoint></thermostat_functionality>" |
680 | | - ) |
| 629 | + data = f"<thermostat_functionality><setpoint>{temp}</setpoint></thermostat_functionality>" |
681 | 630 |
|
682 | 631 | await self._request(uri, method="put", data=data) |
683 | 632 |
|
|
0 commit comments