@@ -99,13 +99,11 @@ def __init__(self, device):
99
99
tempSettable = False
100
100
if controlMode == "roomTemperature" :
101
101
tempSettable = device .getData (ATTR_TARGET_ROOM_TEMPERATURE )["settable" ]
102
- if controlMode == "leavingWaterTemperature" :
102
+ if controlMode in ( "leavingWaterTemperature" , "externalRoomTemperature" ) :
103
103
if device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET ) is not None :
104
104
tempSettable = device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["settable" ]
105
105
if device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE ) is not None :
106
106
tempSettable = device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE )["settable" ]
107
- if controlMode == "externalRoomTemperature" :
108
- tempSettable = device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["settable" ]
109
107
if tempSettable :
110
108
self ._supported_features = SUPPORT_TARGET_TEMPERATURE
111
109
@@ -150,13 +148,11 @@ async def _set(self, settings):
150
148
controlMode = self ._device .getValue (ATTR_CONTROL_MODE )
151
149
if controlMode == "roomTemperature" :
152
150
values [HA_ATTR_TO_DAIKIN [ATTR_ROOM_TEMPERATURE ]] = str (int (value ))
153
- if controlMode == "leavingWaterTemperature" :
151
+ if controlMode in ( "leavingWaterTemperature" , "externalRoomTemperature" ) :
154
152
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET ) is not None :
155
153
values [HA_ATTR_TO_DAIKIN [ATTR_LEAVINGWATER_OFFSET ]] = str (int (value ))
156
154
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE ) is not None :
157
155
values [HA_ATTR_TO_DAIKIN [ATTR_LEAVINGWATER_TEMPERATURE ]] = str (int (value ))
158
- if controlMode == "externalRoomTemperature" :
159
- values [HA_ATTR_TO_DAIKIN [ATTR_LEAVINGWATER_OFFSET ]] = str (int (value ))
160
156
except ValueError :
161
157
_LOGGER .error ("Invalid temperature %s" , value )
162
158
@@ -200,9 +196,7 @@ def current_temperature(self):
200
196
# room temperature do return that
201
197
if controlMode == "roomTemperature" :
202
198
currentTemp = self ._device .getValue (ATTR_ROOM_TEMPERATURE )
203
- if controlMode == "leavingWaterTemperature" :
204
- currentTemp = self ._device .getValue (ATTR_LEAVINGWATER_TEMPERATURE )
205
- if controlMode == "externalRoomTemperature" :
199
+ if controlMode in ("leavingWaterTemperature" , "externalRoomTemperature" ):
206
200
currentTemp = self ._device .getValue (ATTR_LEAVINGWATER_TEMPERATURE )
207
201
_LOGGER .debug ("Current temperature: %s" , currentTemp )
208
202
return currentTemp
@@ -220,13 +214,11 @@ def max_temp(self):
220
214
maxTemp = DEFAULT_MAX_TEMP
221
215
if controlMode == "roomTemperature" :
222
216
maxTemp = float (self ._device .getData (ATTR_TARGET_ROOM_TEMPERATURE )["maxValue" ])
223
- if controlMode == "leavingWaterTemperature" :
217
+ if controlMode in ( "leavingWaterTemperature" , "externalRoomTemperature" ) :
224
218
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET ) is not None :
225
219
maxTemp = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["maxValue" ])
226
220
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE ) is not None :
227
221
maxTemp = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE )["maxValue" ])
228
- if controlMode == "externalRoomTemperature" :
229
- maxTemp = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["maxValue" ])
230
222
_LOGGER .debug ("Max temperature: %s" , maxTemp )
231
223
return maxTemp
232
224
@@ -243,13 +235,11 @@ def min_temp(self):
243
235
minTemp = DEFAULT_MIN_TEMP
244
236
if controlMode == "roomTemperature" :
245
237
minTemp = float (self ._device .getData (ATTR_TARGET_ROOM_TEMPERATURE )["minValue" ])
246
- if controlMode == "leavingWaterTemperature" :
238
+ if controlMode in ( "leavingWaterTemperature" , "externalRoomTemperature" ) :
247
239
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET ) is not None :
248
240
minTemp = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["minValue" ])
249
241
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE ) is not None :
250
242
minTemp = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE )["minValue" ])
251
- if controlMode == "externalRoomTemperature" :
252
- minTemp = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["minValue" ])
253
243
_LOGGER .debug ("Min temperature: %s" , minTemp )
254
244
return minTemp
255
245
@@ -265,13 +255,11 @@ def target_temperature(self):
265
255
targetTemp = None
266
256
if controlMode == "roomTemperature" :
267
257
targetTemp = float (self ._device .getValue (ATTR_TARGET_ROOM_TEMPERATURE ))
268
- if controlMode == "leavingWaterTemperature" :
258
+ if controlMode in ( "leavingWaterTemperature" , "externalRoomTemperature" ) :
269
259
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET ) is not None :
270
260
targetTemp = float (self ._device .getValue (ATTR_TARGET_LEAVINGWATER_OFFSET ))
271
261
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE ) is not None :
272
262
targetTemp = float (self ._device .getValue (ATTR_TARGET_LEAVINGWATER_TEMPERATURE ))
273
- if controlMode == "externalRoomTemperature" :
274
- targetTemp = float (self ._device .getValue (ATTR_TARGET_LEAVINGWATER_OFFSET ))
275
263
_LOGGER .debug ("Target temperature: %s" , targetTemp )
276
264
return targetTemp
277
265
@@ -288,13 +276,11 @@ def target_temperature_step(self):
288
276
tempStep = None
289
277
if controlMode == "roomTemperature" :
290
278
tempStep = float (self ._device .getData (ATTR_TARGET_ROOM_TEMPERATURE )["stepValue" ])
291
- if controlMode == "leavingWaterTemperature" :
279
+ if controlMode in ( "leavingWaterTemperature" , "externalRoomTemperature" ) :
292
280
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET ) is not None :
293
281
tempStep = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["stepValue" ])
294
282
if self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE ) is not None :
295
283
tempStep = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_TEMPERATURE )["stepValue" ])
296
- if controlMode == "externalRoomTemperature" :
297
- tempStep = float (self ._device .getData (ATTR_TARGET_LEAVINGWATER_OFFSET )["stepValue" ])
298
284
_LOGGER .debug ("Step temperature: %s" , tempStep )
299
285
return tempStep
300
286
0 commit comments