@@ -257,7 +257,7 @@ def validate_values(self,response_data,allvalue_dict):
257257 else :
258258 return True
259259
260- def set_values (self , * value_tuples ):
260+ async def set_values (self , * value_tuples ):
261261 """Writes values to UHome, accepts tuples of (UponorValue, New Value)"""
262262
263263 #_LOGGER.debug("Requested write to %d values", len(value_tuples))
@@ -268,7 +268,7 @@ def set_values(self, *value_tuples):
268268 obj = {'id' : str (tpl [0 ].id ), 'properties' : {'85' : {'value' : str (tpl [1 ])}}}
269269 self .add_request_object (req , obj )
270270
271- self .hass . async_create_task ( self . do_rest_call (req ) )
271+ await self .do_rest_call (req )
272272
273273 # Apply new values, after the API call succeeds
274274 for tpl in value_tuples :
@@ -355,38 +355,38 @@ def is_valid(self):
355355 return - 40 <= self .by_name ('room_temperature' ).value and self .by_name ('room_temperature' ).value <= 100 and \
356356 1 <= self .by_name ('room_setpoint' ).value and self .by_name ('room_setpoint' ).value <= 40
357357
358- def set_name (self , name ):
358+ async def set_name (self , name ):
359359 """Updates the thermostats room name to a new value"""
360- self .uponor_client .set_values ((self .by_name ('room_name' ), name ))
360+ await self .uponor_client .set_values ((self .by_name ('room_name' ), name ))
361361
362- def set_setpoint (self , temperature ):
362+ async def set_setpoint (self , temperature ):
363363 """Updates the thermostats setpoint to a new value"""
364- self .uponor_client .set_values (
364+ await self .uponor_client .set_values (
365365 (self .by_name ('setpoint_write_enable' ), 0 ),
366366 (self .by_name ('room_setpoint' ), temperature )
367367 )
368368
369- def set_hvac_mode (self , value ):
369+ async def set_hvac_mode (self , value ):
370370 """Updates the thermostats mode to a new value"""
371- self .uponor_client .set_values (
371+ await self .uponor_client .set_values (
372372 (self .uponor_client .uhome .by_name ('allow_hc_mode_change' ), 0 ),
373373 (self .uponor_client .uhome .by_name ('hc_mode' ), value ),
374374 )
375375
376- def set_preset_mode (self , value ):
376+ async def set_preset_mode (self , value ):
377377 """Updates the thermostats mode to a new value"""
378- self .uponor_client .set_values ((self .uponor_client .uhome .by_name ('forced_eco_mode' ), value ))
378+ await self .uponor_client .set_values ((self .uponor_client .uhome .by_name ('forced_eco_mode' ), value ))
379379
380- def set_manual_mode (self ):
381- self .uponor_client .set_values (
380+ async def set_manual_mode (self ):
381+ await self .uponor_client .set_values (
382382 (self .uponor_client .uhome .by_name ('setpoint_write_enable' ), 1 ),
383383 (self .uponor_client .uhome .by_name ('rh_control_activation' ), 1 ),
384384 (self .uponor_client .uhome .by_name ('dehumidifier_control_activation' ), 0 ),
385385 (self .uponor_client .uhome .by_name ('setpoint_write_enable' ), 0 ),
386386 )
387387
388- def set_auto_mode (self ):
389- self .uponor_client .set_values (
388+ async def set_auto_mode (self ):
389+ await self .uponor_client .set_values (
390390 (self .uponor_client .uhome .by_name ('setpoint_write_enable' ), 1 ),
391391 (self .uponor_client .uhome .by_name ('rh_control_activation' ), 0 ),
392392 (self .uponor_client .uhome .by_name ('dehumidifier_control_activation' ), 0 ),
0 commit comments