Skip to content

Commit c724add

Browse files
committed
Revert "Improve main function docstrings"
This reverts commit 925ac8d.
1 parent 4d2a426 commit c724add

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

plugwise/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,15 @@ async def _smile_detect_legacy(
305305
return return_model
306306

307307
async def full_xml_update(self) -> None:
308-
"""Perform a first fetch of the Plugwise server XML data."""
308+
"""Helper-function used for testing."""
309309
await self._smile_api.full_xml_update()
310310

311311
def get_all_gateway_entities(self) -> None:
312-
"""Collect the Plugwise gateway entities and their data and states from the received raw XML-data."""
312+
"""Helper-function used for testing."""
313313
self._smile_api.get_all_gateway_entities()
314314

315315
async def async_update(self) -> PlugwiseData:
316-
"""Update the Plughwise gateway entities and their data and states."""
316+
"""Update the various entities and their states."""
317317
data = PlugwiseData(devices={}, gateway={})
318318
try:
319319
data = await self._smile_api.async_update()

plugwise/legacy/smile.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(
8383
self._previous_day_number: str = "0"
8484

8585
async def full_xml_update(self) -> None:
86-
"""Perform a first fetch of the Plugwise server XML data."""
86+
"""Perform a first fetch of all XML data, needed for initialization."""
8787
self._domain_objects = await self.request(DOMAIN_OBJECTS)
8888
self._locations = await self.request(LOCATIONS)
8989
self._modules = await self.request(MODULES)
@@ -92,23 +92,24 @@ async def full_xml_update(self) -> None:
9292
self._appliances = await self.request(APPLIANCES)
9393

9494
def get_all_gateway_entities(self) -> None:
95-
"""Collect the Plugwise gateway entities and their data and states from the received raw XML-data.
95+
"""Collect the gateway entities from the received raw XML-data.
9696
97-
First, collect all the connected entities and their initial data.
98-
Collect and add switching- and/or pump-group entities.
99-
Finally, collect the data and states for each entity.
97+
Run this functions once to gather the initial device configuration,
98+
then regularly run async_update() to refresh the device data.
10099
"""
100+
# Gather all the devices and their initial data
101101
self._all_appliances()
102+
103+
# Collect and add switching- and/or pump-group devices
102104
if group_data := self._get_group_switches():
103105
self.gw_entities.update(group_data)
104106

107+
# Collect the remaining data for all entities
105108
self._all_entity_data()
106109

107110
async def async_update(self) -> PlugwiseData:
108-
"""Perform an full update update at day-change: re-collect all gateway entities and their data and states.
109-
110-
Otherwise perform an incremental update: only collect the entities updated data and states.
111-
"""
111+
"""Perform an incremental update for updating the various device states."""
112+
# Perform a full update at day-change
112113
day_number = dt.datetime.now().strftime("%w")
113114
if (
114115
day_number # pylint: disable=consider-using-assignment-expr
@@ -128,6 +129,7 @@ async def async_update(self) -> PlugwiseData:
128129
raise DataMissingError(
129130
"No (full) Plugwise legacy data received"
130131
) from err
132+
# Otherwise perform an incremental update
131133
else:
132134
try:
133135
self._domain_objects = await self.request(DOMAIN_OBJECTS)

plugwise/smile.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,43 +97,42 @@ def __init__(
9797
SmileData.__init__(self)
9898

9999
async def full_xml_update(self) -> None:
100-
"""Perform a first fetch of the Plugwise server XML data."""
100+
"""Perform a first fetch of all XML data, needed for initialization."""
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 Plugwise gateway entities and their data and states from the received raw XML-data.
105+
"""Collect the gateway entities from the received raw XML-data.
106106
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.
107+
Run this functions once to gather the initial configuration,
108+
then regularly run async_update() to refresh the entity data.
111109
"""
110+
# Gather all the entities and their initial data
112111
self._all_appliances()
113112
if self._is_thermostat:
113+
if self.smile(ADAM):
114+
self._scan_thermostats()
115+
# Collect a list of thermostats with offset-capability
114116
self.therms_with_offset_func = (
115117
self._get_appliances_with_offset_functionality()
116118
)
117-
if self.smile(ADAM):
118-
self._scan_thermostats()
119119

120+
# Collect and add switching- and/or pump-group devices
120121
if group_data := self._get_group_switches():
121122
self.gw_entities.update(group_data)
122123

124+
# Collect the remaining data for all entities
123125
self._all_entity_data()
124126

125127
async def async_update(self) -> PlugwiseData:
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-
"""
128+
"""Perform an incremental update for updating the various device states."""
130129
self.gw_data: GatewayData = {}
131130
self.gw_entities: dict[str, GwEntityData] = {}
132131
self._zones: dict[str, GwEntityData] = {}
133132
try:
134133
await self.full_xml_update()
135134
self.get_all_gateway_entities()
136-
# Set self._cooling_enabled - required for set_temperature(),
135+
# Set self._cooling_enabled - required for set_temperature,
137136
# also, check for a failed data-retrieval
138137
if "heater_id" in self.gw_data:
139138
heat_cooler = self.gw_entities[self.gw_data["heater_id"]]

0 commit comments

Comments
 (0)