99
1010from plugwise .constants import (
1111 ANNA ,
12+ GROUP_TYPES ,
1213 NONE ,
1314 PRIORITY_DEVICE_CLASSES ,
1415 SPECIAL_PLUG_TYPES ,
@@ -187,15 +188,15 @@ def _entity_switching_group(self, entity: GwEntityData, data: GwEntityData) -> N
187188 data ["switches" ]["relay" ] = counter != 0
188189 self ._count += 1
189190
190- def _get_group_switches (self ) -> dict [str , GwEntityData ]:
191+ def _get_groups (self ) -> dict [str , GwEntityData ]:
191192 """Helper-function for smile.py: get_all_gateway_entities().
192193
193194 Collect switching- or pump-group info.
194195 """
195- switch_groups : dict [str , GwEntityData ] = {}
196- # P1 and Anna don't have switchgroups
196+ groups : dict [str , GwEntityData ] = {}
197+ # P1 and Anna don't have groups
197198 if self .smile .type == "power" or self .check_name (ANNA ):
198- return switch_groups
199+ return groups
199200
200201 for group in self ._domain_objects .findall ("./group" ):
201202 members : list [str ] = []
@@ -208,17 +209,17 @@ def _get_group_switches(self) -> dict[str, GwEntityData]:
208209 if item .attrib ["id" ] in self .gw_entities :
209210 members .append (item .attrib ["id" ])
210211
211- if group_type in SWITCH_GROUP_TYPES and members :
212- switch_groups [group_id ] = {
212+ if group_type in GROUP_TYPES and members :
213+ groups [group_id ] = {
213214 "dev_class" : group_type ,
214- "model" : "Switchgroup " ,
215+ "model" : "Group " ,
215216 "name" : group_name ,
216217 "members" : members ,
217218 "vendor" : "Plugwise" ,
218219 }
219220 self ._count += 5
220221
221- return switch_groups
222+ return groups
222223
223224 def _get_lock_state (
224225 self , xml : etree .Element , data : GwEntityData , stretch_v2 : bool = False
0 commit comments