2222 NOTIFICATIONS ,
2323 OFF ,
2424 RULES ,
25+ STATE_ON ,
2526 GwEntityData ,
2627 ThermoLoc ,
2728)
@@ -379,6 +380,7 @@ async def set_switch_state(
379380 self , appl_id : str , members : list [str ] | None , model : str , state : str
380381 ) -> bool :
381382 """Set the given State of the relevant Switch."""
383+ req_state = state == STATE_ON
382384 switch = Munch ()
383385 switch .actuator = "actuator_functionalities"
384386 switch .device = "relay"
@@ -423,7 +425,7 @@ async def set_switch_state(
423425 return False
424426
425427 await self .call_request (uri , method = "put" , data = data )
426- return True
428+ return req_state
427429
428430 async def _set_groupswitch_member_state (
429431 self , members : list [str ], state : str , switch : Munch
@@ -432,6 +434,7 @@ async def _set_groupswitch_member_state(
432434
433435 Set the given State of the relevant Switch within a group of members.
434436 """
437+ switched = 0
435438 for member in members :
436439 locator = f'appliance[@id="{ member } "]/{ switch .actuator } /{ switch .func_type } '
437440 switch_id = self ._domain_objects .find (locator ).attrib ["id" ]
@@ -443,8 +446,9 @@ async def _set_groupswitch_member_state(
443446 )
444447 if not self .gw_entities [member ]["switches" ].get ("lock" ):
445448 await self .call_request (uri , method = "put" , data = data )
449+ switched += 1
446450
447- return True
451+ return switched > 0
448452
449453 async def set_temperature (self , loc_id : str , items : dict [str , float ]) -> None :
450454 """Set the given Temperature on the relevant Thermostat."""
0 commit comments