|
38 | 38 |
|
39 | 39 |
|
40 | 40 | class Smile(SmileComm): |
41 | | - """The Plugwise SmileConnect class.""" |
| 41 | + """The main Plugwise Smile API class.""" |
42 | 42 |
|
43 | 43 | # pylint: disable=too-many-instance-attributes, too-many-public-methods |
44 | 44 |
|
@@ -91,7 +91,7 @@ def __init__( |
91 | 91 | self.smile_zigbee_mac_address: str | None = None |
92 | 92 |
|
93 | 93 | 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.""" |
95 | 95 | result = await self._request(DOMAIN_OBJECTS) |
96 | 96 | # Work-around for Stretch fw 2.7.18 |
97 | 97 | if not (vendor_names := result.findall("./module/vendor_name")): |
@@ -186,7 +186,7 @@ async def connect(self) -> Version | None: |
186 | 186 | async def _smile_detect(self, result: etree, dsmrmain: etree) -> None: |
187 | 187 | """Helper-function for connect(). |
188 | 188 |
|
189 | | - Detect which type of Smile is connected. |
| 189 | + Detect which type of Plugwise Gateway is being connected. |
190 | 190 | """ |
191 | 191 | model: str = "Unknown" |
192 | 192 | if (gateway := result.find("./gateway")) is not None: |
@@ -260,7 +260,10 @@ async def _smile_detect(self, result: etree, dsmrmain: etree) -> None: |
260 | 260 | async def _smile_detect_legacy( |
261 | 261 | self, result: etree, dsmrmain: etree, model: str |
262 | 262 | ) -> 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 | + """ |
264 | 267 | return_model = model |
265 | 268 | # Stretch: find the MAC of the zigbee master_controller (= Stick) |
266 | 269 | if (network := result.find("./module/protocols/master_controller")) is not None: |
@@ -305,15 +308,15 @@ async def _smile_detect_legacy( |
305 | 308 | return return_model |
306 | 309 |
|
307 | 310 | async def full_xml_update(self) -> None: |
308 | | - """Helper-function used for testing.""" |
| 311 | + """Perform a first fetch of the Plugwise server XML data.""" |
309 | 312 | await self._smile_api.full_xml_update() |
310 | 313 |
|
311 | 314 | def get_all_gateway_entities(self) -> None: |
312 | | - """Helper-function used for testing.""" |
| 315 | + """Collect the Plugwise Gateway entities and their data and states from the received raw XML-data.""" |
313 | 316 | self._smile_api.get_all_gateway_entities() |
314 | 317 |
|
315 | 318 | async def async_update(self) -> PlugwiseData: |
316 | | - """Update the various entities and their states.""" |
| 319 | + """Update the Plughwise Gateway entities and their data and states.""" |
317 | 320 | data = PlugwiseData(devices={}, gateway={}) |
318 | 321 | try: |
319 | 322 | data = await self._smile_api.async_update() |
|
0 commit comments