Skip to content

Commit 2cec443

Browse files
committed
More docstring improvements
1 parent 27a2475 commit 2cec443

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

plugwise/__init__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
class Smile(SmileComm):
41-
"""The Plugwise SmileConnect class."""
41+
"""The main Plugwise Smile API class."""
4242

4343
# pylint: disable=too-many-instance-attributes, too-many-public-methods
4444

@@ -91,7 +91,7 @@ def __init__(
9191
self.smile_zigbee_mac_address: str | None = None
9292

9393
async def connect(self) -> Version | None:
94-
"""Connect to Plugwise device and determine its name, type and version."""
94+
"""Connect to the Plugwise Gateway and determine its name, type, version, and other data."""
9595
result = await self._request(DOMAIN_OBJECTS)
9696
# Work-around for Stretch fw 2.7.18
9797
if not (vendor_names := result.findall("./module/vendor_name")):
@@ -186,7 +186,7 @@ async def connect(self) -> Version | None:
186186
async def _smile_detect(self, result: etree, dsmrmain: etree) -> None:
187187
"""Helper-function for connect().
188188
189-
Detect which type of Smile is connected.
189+
Detect which type of Plugwise Gateway is being connected.
190190
"""
191191
model: str = "Unknown"
192192
if (gateway := result.find("./gateway")) is not None:
@@ -260,7 +260,10 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None:
260260
async def _smile_detect_legacy(
261261
self, result: etree, dsmrmain: etree, model: str
262262
) -> str:
263-
"""Helper-function for _smile_detect()."""
263+
"""Helper-function for _smile_detect().
264+
265+
Detect which type of legacy Plugwise Gateway is being connected.
266+
"""
264267
return_model = model
265268
# Stretch: find the MAC of the zigbee master_controller (= Stick)
266269
if (network := result.find("./module/protocols/master_controller")) is not None:
@@ -309,11 +312,11 @@ async def full_xml_update(self) -> None:
309312
await self._smile_api.full_xml_update()
310313

311314
def get_all_gateway_entities(self) -> None:
312-
"""Collect the Plugwise gateway entities and their data and states from the received raw XML-data."""
315+
"""Collect the Plugwise Gateway entities and their data and states from the received raw XML-data."""
313316
self._smile_api.get_all_gateway_entities()
314317

315318
async def async_update(self) -> PlugwiseData:
316-
"""Update the Plughwise gateway entities and their data and states."""
319+
"""Update the Plughwise Gateway entities and their data and states."""
317320
data = PlugwiseData(devices={}, gateway={})
318321
try:
319322
data = await self._smile_api.async_update()

plugwise/legacy/smile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535

3636
class SmileLegacyAPI(SmileLegacyData):
37-
"""The Plugwise SmileLegacyAPI class."""
37+
"""The Plugwise SmileLegacyAPI helper class for actual Plugwise legacy devices."""
3838

3939
# pylint: disable=too-many-instance-attributes, too-many-public-methods
4040

0 commit comments

Comments
 (0)