@@ -77,21 +77,21 @@ def __init__(
77
77
DeviceAttributes .tbh : False ,
78
78
DeviceAttributes .mode : 1 ,
79
79
DeviceAttributes .mode_auto : 1 ,
80
- DeviceAttributes .zone_target_temp : [25 , 25 ],
81
- DeviceAttributes .dhw_target_temp : 25 ,
82
- DeviceAttributes .room_target_temp : 30 ,
83
- DeviceAttributes .zone_heating_temp_max : [55 , 55 ],
84
- DeviceAttributes .zone_heating_temp_min : [25 , 25 ],
85
- DeviceAttributes .zone_cooling_temp_max : [25 , 25 ],
86
- DeviceAttributes .zone_cooling_temp_min : [5 , 5 ],
87
- DeviceAttributes .room_temp_max : 60 ,
88
- DeviceAttributes .room_temp_min : 34 ,
89
- DeviceAttributes .dhw_temp_max : 60 ,
90
- DeviceAttributes .dhw_temp_min : 20 ,
80
+ DeviceAttributes .zone_target_temp : [25.0 , 25.0 ],
81
+ DeviceAttributes .dhw_target_temp : 25.0 ,
82
+ DeviceAttributes .room_target_temp : 30.0 ,
83
+ DeviceAttributes .zone_heating_temp_max : [55.0 , 55.0 ],
84
+ DeviceAttributes .zone_heating_temp_min : [25.0 , 25.0 ],
85
+ DeviceAttributes .zone_cooling_temp_max : [25.0 , 25.0 ],
86
+ DeviceAttributes .zone_cooling_temp_min : [5.0 , 5.0 ],
87
+ DeviceAttributes .room_temp_max : 60.0 ,
88
+ DeviceAttributes .room_temp_min : 34.0 ,
89
+ DeviceAttributes .dhw_temp_max : 60.0 ,
90
+ DeviceAttributes .dhw_temp_min : 20.0 ,
91
91
DeviceAttributes .tank_actual_temperature : None ,
92
- DeviceAttributes .target_temperature : [25 , 25 ],
93
- DeviceAttributes .temperature_max : [0 , 0 ],
94
- DeviceAttributes .temperature_min : [0 , 0 ],
92
+ DeviceAttributes .target_temperature : [25.0 , 25.0 ],
93
+ DeviceAttributes .temperature_max : [0.0 , 0. 0 ],
94
+ DeviceAttributes .temperature_min : [0.0 , 0. 0 ],
95
95
DeviceAttributes .total_energy_consumption : None ,
96
96
DeviceAttributes .status_heating : None ,
97
97
DeviceAttributes .status_dhw : None ,
@@ -230,7 +230,7 @@ def make_message_set(self) -> MessageSet:
230
230
message .fast_dhw = self ._attributes [DeviceAttributes .fast_dhw ]
231
231
return message
232
232
233
- def set_attribute (self , attr : str , value : bool | int | str ) -> None :
233
+ def set_attribute (self , attr : str , value : bool | float | str ) -> None :
234
234
"""Midea C3 device set attribute."""
235
235
message : (
236
236
MessageSet | MessageSetECO | MessageSetSilent | MessageSetDisinfect | None
@@ -245,6 +245,9 @@ def set_attribute(self, attr: str, value: bool | int | str) -> None:
245
245
DeviceAttributes .fast_dhw ,
246
246
DeviceAttributes .dhw_target_temp ,
247
247
]:
248
+ # convert input float dhw_target_temp to int for message byte
249
+ if attr == DeviceAttributes .dhw_target_temp :
250
+ value = int (value )
248
251
message = self .make_message_set ()
249
252
setattr (message , str (attr ), value )
250
253
elif attr == DeviceAttributes .eco_mode :
@@ -295,9 +298,11 @@ def set_target_temperature(
295
298
296
299
message = self .make_message_set ()
297
300
if self ._attributes [DeviceAttributes .zone_temp_type ][zone ]:
298
- message .zone_target_temp [zone ] = target_temperature
301
+ # convert float target_temperature to int
302
+ message .zone_target_temp [zone ] = int (target_temperature )
299
303
else :
300
- message .room_target_temp = target_temperature
304
+ # convert float target_temperature to int
305
+ message .room_target_temp = int (target_temperature )
301
306
if mode is not None :
302
307
if zone == 0 :
303
308
message .zone1_power = True
0 commit comments