|
3 | 3 |
|
4 | 4 | from PyViCare.PyViCareHeatingDevice import (HeatingDevice, |
5 | 5 | HeatingDeviceWithComponent) |
6 | | -from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleNotSupported |
| 6 | +from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleAPICommandErrors, handleNotSupported |
7 | 7 |
|
8 | 8 |
|
9 | 9 | class HeatPump(HeatingDevice): |
@@ -115,7 +115,7 @@ def setActiveVentilationMode(self, mode): |
115 | 115 | ---------- |
116 | 116 | mode : str |
117 | 117 | Valid mode can be obtained using getModes() |
118 | | - |
| 118 | +
|
119 | 119 | Returns |
120 | 120 | ------- |
121 | 121 | result: json |
@@ -144,14 +144,112 @@ def activateVentilationProgram(self, program): |
144 | 144 | Parameters |
145 | 145 | ---------- |
146 | 146 | program : str |
147 | | - |
| 147 | +
|
148 | 148 | Returns |
149 | 149 | ------- |
150 | 150 | result: json |
151 | 151 | json representation of the answer |
152 | 152 | """ |
153 | 153 | return self.service.setProperty(f"ventilation.operating.programs.{program}", "activate", {}) |
154 | 154 |
|
| 155 | + @handleNotSupported |
| 156 | + def getDomesticHotWaterHysteresisUnit(self) -> str: |
| 157 | + return str(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["value"]["unit"]) |
| 158 | + |
| 159 | + @handleNotSupported |
| 160 | + def getDomesticHotWaterHysteresis(self) -> float: |
| 161 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["value"]["value"]) |
| 162 | + |
| 163 | + @handleNotSupported |
| 164 | + def getDomesticHotWaterHysteresisMin(self) -> float: |
| 165 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresis"]["params"]["hysteresis"]["constraints"]["min"]) |
| 166 | + |
| 167 | + @handleNotSupported |
| 168 | + def getDomesticHotWaterHysteresisMax(self) -> float: |
| 169 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresis"]["params"]["hysteresis"]["constraints"]["max"]) |
| 170 | + |
| 171 | + @handleNotSupported |
| 172 | + def getDomesticHotWaterHysteresisStepping(self) -> float: |
| 173 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresis"]["params"]["hysteresis"]["constraints"]["stepping"]) |
| 174 | + |
| 175 | + @handleAPICommandErrors |
| 176 | + def setDomesticHotWaterHysteresis(self, temperature: float) -> Any: |
| 177 | + """ Set the hysteresis temperature for domestic host water |
| 178 | + Parameters |
| 179 | + ---------- |
| 180 | + temperature : float |
| 181 | + hysteresis temperature |
| 182 | +
|
| 183 | + Returns |
| 184 | + ------- |
| 185 | + result: json |
| 186 | + json representation of the answer |
| 187 | + """ |
| 188 | + return self.service.setProperty("heating.dhw.temperature.hysteresis", "setHysteresis", {'hysteresis': temperature}) |
| 189 | + |
| 190 | + @handleNotSupported |
| 191 | + def getDomesticHotWaterHysteresisSwitchOn(self) -> float: |
| 192 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["switchOnValue"]["value"]) |
| 193 | + |
| 194 | + @handleNotSupported |
| 195 | + def getDomesticHotWaterHysteresisSwitchOnMin(self) -> float: |
| 196 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOnValue"]["params"]["hysteresis"]["constraints"]["min"]) |
| 197 | + |
| 198 | + @handleNotSupported |
| 199 | + def getDomesticHotWaterHysteresisSwitchOnMax(self) -> float: |
| 200 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOnValue"]["params"]["hysteresis"]["constraints"]["max"]) |
| 201 | + |
| 202 | + @handleNotSupported |
| 203 | + def getDomesticHotWaterHysteresisSwitchOnStepping(self) -> float: |
| 204 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOnValue"]["params"]["hysteresis"]["constraints"]["stepping"]) |
| 205 | + |
| 206 | + @handleAPICommandErrors |
| 207 | + def setDomesticHotWaterHysteresisSwitchOn(self, temperature: float) -> Any: |
| 208 | + """ Set the hysteresis switch on temperature for domestic host water |
| 209 | + Parameters |
| 210 | + ---------- |
| 211 | + temperature : float |
| 212 | + hysteresis switch on temperature |
| 213 | +
|
| 214 | + Returns |
| 215 | + ------- |
| 216 | + result: json |
| 217 | + json representation of the answer |
| 218 | + """ |
| 219 | + return self.service.setProperty("heating.dhw.temperature.hysteresis", "setHysteresisSwitchOnValue", {'hysteresis': temperature}) |
| 220 | + |
| 221 | + @handleNotSupported |
| 222 | + def getDomesticHotWaterHysteresisSwitchOff(self) -> float: |
| 223 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["properties"]["switchOffValue"]["value"]) |
| 224 | + |
| 225 | + @handleNotSupported |
| 226 | + def getDomesticHotWaterHysteresisSwitchOffMin(self) -> float: |
| 227 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOffValue"]["params"]["hysteresis"]["constraints"]["min"]) |
| 228 | + |
| 229 | + @handleNotSupported |
| 230 | + def getDomesticHotWaterHysteresisSwitchOffMax(self) -> float: |
| 231 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOffValue"]["params"]["hysteresis"]["constraints"]["max"]) |
| 232 | + |
| 233 | + @handleNotSupported |
| 234 | + def getDomesticHotWaterHysteresisSwitchOffStepping(self) -> float: |
| 235 | + return float(self.service.getProperty("heating.dhw.temperature.hysteresis")["commands"]["setHysteresisSwitchOffValue"]["params"]["hysteresis"]["constraints"]["stepping"]) |
| 236 | + |
| 237 | + @handleAPICommandErrors |
| 238 | + def setDomesticHotWaterHysteresisSwitchOff(self, temperature: float) -> Any: |
| 239 | + """ Set the hysteresis switch off temperature for domestic host water |
| 240 | + Parameters |
| 241 | + ---------- |
| 242 | + temperature : float |
| 243 | + hysteresis switch off temperature |
| 244 | +
|
| 245 | + Returns |
| 246 | + ------- |
| 247 | + result: json |
| 248 | + json representation of the answer |
| 249 | + """ |
| 250 | + return self.service.setProperty("heating.dhw.temperature.hysteresis", "setHysteresisSwitchOffValue", {'hysteresis': temperature}) |
| 251 | + |
| 252 | + |
155 | 253 | class Compressor(HeatingDeviceWithComponent): |
156 | 254 |
|
157 | 255 | @property |
|
0 commit comments