@@ -97,42 +97,43 @@ def __init__(
9797 SmileData .__init__ (self )
9898
9999 async def full_xml_update (self ) -> None :
100- """Perform a first fetch of all XML data, needed for initialization ."""
100+ """Perform a first fetch of the Plugwise server XML data ."""
101101 self ._domain_objects = await self .request (DOMAIN_OBJECTS )
102102 self ._get_plugwise_notifications ()
103103
104104 def get_all_gateway_entities (self ) -> None :
105- """Collect the gateway entities from the received raw XML-data.
105+ """Collect the Plugwise gateway entities and their data and states from the received raw XML-data.
106106
107- Run this functions once to gather the initial configuration,
108- then regularly run async_update() to refresh the entity data.
107+ First, collect all the connected entities and their initial data.
108+ If a thermostat-gateway, collect a list of thermostats with offset-capability.
109+ Collect and add switching- and/or pump-group entities.
110+ Finally, collect the data and states for each entity.
109111 """
110- # Gather all the entities and their initial data
111112 self ._all_appliances ()
112113 if self ._is_thermostat :
113- if self .smile (ADAM ):
114- self ._scan_thermostats ()
115- # Collect a list of thermostats with offset-capability
116114 self .therms_with_offset_func = (
117115 self ._get_appliances_with_offset_functionality ()
118116 )
117+ if self .smile (ADAM ):
118+ self ._scan_thermostats ()
119119
120- # Collect and add switching- and/or pump-group devices
121120 if group_data := self ._get_group_switches ():
122121 self .gw_entities .update (group_data )
123122
124- # Collect the remaining data for all entities
125123 self ._all_entity_data ()
126124
127125 async def async_update (self ) -> PlugwiseData :
128- """Perform an incremental update for updating the various device states."""
126+ """Perform an full update: re-collect all gateway entities and their data and states.
127+
128+ Any change in the connected entities will be detected immediately.
129+ """
129130 self .gw_data : GatewayData = {}
130131 self .gw_entities : dict [str , GwEntityData ] = {}
131132 self ._zones : dict [str , GwEntityData ] = {}
132133 try :
133134 await self .full_xml_update ()
134135 self .get_all_gateway_entities ()
135- # Set self._cooling_enabled - required for set_temperature,
136+ # Set self._cooling_enabled - required for set_temperature() ,
136137 # also, check for a failed data-retrieval
137138 if "heater_id" in self .gw_data :
138139 heat_cooler = self .gw_entities [self .gw_data ["heater_id" ]]
0 commit comments