From 6cde0872e8fcd3c2c2ca1057f4b970e015469c6a Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 07:57:42 +0100 Subject: [PATCH 1/9] pep257: fix docstring ./pyfritzhome/fritzhome.py:351 in public method `has_templates`: D400: First line should end with a period (not 's') Signed-off-by: Heiko Thiery --- pyfritzhome/fritzhome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfritzhome/fritzhome.py b/pyfritzhome/fritzhome.py index e90d43c..81ac5e8 100644 --- a/pyfritzhome/fritzhome.py +++ b/pyfritzhome/fritzhome.py @@ -349,7 +349,7 @@ def set_blind_stop(self, ain): # Template-related commands def has_templates(self): - """Check if the Fritz!Box supports smarthome templates""" + """Check if the Fritz!Box supports smarthome templates.""" plain = self._aha_request("gettemplatelistinfos") try: ElementTree.fromstring(plain) From 7eee6ae1048df8494dda90fc56a8271254a97f18 Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 07:58:28 +0100 Subject: [PATCH 2/9] pep257: fix docstring ./pyfritzhome/fritzhome.py:395 in public method `apply_template`: D401: First line should be in imperative mood ('Applie', not 'Applies') Signed-off-by: Heiko Thiery --- pyfritzhome/fritzhome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfritzhome/fritzhome.py b/pyfritzhome/fritzhome.py index 81ac5e8..cfc574c 100644 --- a/pyfritzhome/fritzhome.py +++ b/pyfritzhome/fritzhome.py @@ -393,5 +393,5 @@ def get_template_by_ain(self, ain): return self.get_templates_as_dict()[ain] def apply_template(self, ain): - """Applies a template.""" + """Appliy a template.""" self._aha_request("applytemplate", ain=ain) From a41fbd5fc1f1460b377eeba519914262b1f433e5 Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 08:10:04 +0100 Subject: [PATCH 3/9] pep257: fix docstrings ./pyfritzhome/errors.py:5 in public method `__str__`: D105: Missing docstring in magic method ./pyfritzhome/__init__.py:1 at module level: D104: Missing docstring in public package ./pyfritzhome/devicetypes/__init__.py:1 at module level: D104: Missing docstring in public package ./tests/__init__.py:1 at module level: D104: Missing docstring in public package Signed-off-by: Heiko Thiery --- pyfritzhome/__init__.py | 2 ++ pyfritzhome/devicetypes/__init__.py | 2 ++ pyfritzhome/errors.py | 2 ++ setup.cfg | 2 +- tests/__init__.py | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyfritzhome/__init__.py b/pyfritzhome/__init__.py index 08a7be1..d72d20c 100644 --- a/pyfritzhome/__init__.py +++ b/pyfritzhome/__init__.py @@ -1,3 +1,5 @@ +"""Init file for pyfritzhome.""" + from .errors import InvalidError, LoginError from .fritzhome import Fritzhome from .fritzhomedevice import FritzhomeDevice diff --git a/pyfritzhome/devicetypes/__init__.py b/pyfritzhome/devicetypes/__init__.py index 8a980d8..d698551 100644 --- a/pyfritzhome/devicetypes/__init__.py +++ b/pyfritzhome/devicetypes/__init__.py @@ -1,3 +1,5 @@ +"""Init file for the device types.""" + from .fritzhomedevicealarm import FritzhomeDeviceAlarm from .fritzhomedevicebutton import FritzhomeDeviceButton from .fritzhomedevicepowermeter import FritzhomeDevicePowermeter diff --git a/pyfritzhome/errors.py b/pyfritzhome/errors.py index e0a0ece..b8cc044 100644 --- a/pyfritzhome/errors.py +++ b/pyfritzhome/errors.py @@ -1,8 +1,10 @@ class LoginError(Exception): def __init__(self, user): + """Initialize the an loginError.""" self.user = user def __str__(self): + """Return the error.""" return 'login for user="{}" failed'.format(self.user) diff --git a/setup.cfg b/setup.cfg index 75fffb5..c91bb87 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,4 +60,4 @@ omit = */doc/* [pep257] -ignore = D100,D101,D102,D103,D104,D105,D203,D204 +ignore = D100,D101,D102,D103,D203 diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..aaa5d9f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Init file for the tests.""" From ec2a2e4579ca72680ebeec756d5c6626eeb731fa Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 08:20:25 +0100 Subject: [PATCH 4/9] pep257: add pyfritzhome as match-dir Only check files under the pyfritzhome directory. Signed-off-by: Heiko Thiery --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index c91bb87..b9f3573 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,4 +60,5 @@ omit = */doc/* [pep257] -ignore = D100,D101,D102,D103,D203 +ignore = D100,D101,D203 +match-dir = pyfritzhome/* From 39d50089f157f91d18e138482c37e459a0609cd7 Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 08:21:08 +0100 Subject: [PATCH 5/9] pep257: fix docstrings ./pyfritzhome/fritzhomedevice.py:30 in public method `__init__`: D102: Missing docstring in public method ./pyfritzhome/fritzhome.py:28 in public method `__init__`: D102: Missing docstring in public method ./pyfritzhome/fritzhome.py:127 in public method `update_devices`: D102: Missing docstring in public method ./pyfritzhome/fritzhome.py:340 in public method `set_blind_open`: D102: Missing docstring in public method ./pyfritzhome/fritzhome.py:343 in public method `set_blind_close`: D102: Missing docstring in public method ./pyfritzhome/fritzhome.py:346 in public method `set_blind_stop`: D102: Missing docstring in public method ./pyfritzhome/fritzhome.py:360 in public method `update_templates`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedevicebutton.py:43 in public method `get_button_by_ain`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedevicebutton.py:55 in public method `__init__`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedevicebutton.py:69 in public method `get_node_value`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedevicebutton.py:72 in public method `get_node_value_as_int`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomeentitybase.py:21 in public method `__init__`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomeentitybase.py:46 in public method `get_node_value`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomeentitybase.py:49 in public method `get_node_value_as_int`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomeentitybase.py:52 in public method `get_node_value_as_int_as_bool`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomeentitybase.py:55 in public method `get_temp_from_node`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedeviceblind.py:55 in public method `get_level`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedeviceblind.py:58 in public method `get_level_percentage`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedeviceblind.py:61 in public method `set_level`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedeviceblind.py:64 in public method `set_level_percentage`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedeviceblind.py:67 in public method `set_blind_open`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedeviceblind.py:70 in public method `set_blind_close`: D102: Missing docstring in public method ./pyfritzhome/devicetypes/fritzhomedeviceblind.py:73 in public method `set_blind_stop`: D102: Missing docstring in public method ./tests/helper.py:10 in public method `response`: D102: Missing docstring in public method Signed-off-by: Heiko Thiery --- pyfritzhome/devicetypes/fritzhomedeviceblind.py | 7 +++++++ pyfritzhome/devicetypes/fritzhomedevicebutton.py | 4 ++++ pyfritzhome/devicetypes/fritzhomeentitybase.py | 5 +++++ pyfritzhome/fritzhome.py | 6 ++++++ pyfritzhome/fritzhomedevice.py | 1 + 5 files changed, 23 insertions(+) diff --git a/pyfritzhome/devicetypes/fritzhomedeviceblind.py b/pyfritzhome/devicetypes/fritzhomedeviceblind.py index d7e27d4..91a852f 100644 --- a/pyfritzhome/devicetypes/fritzhomedeviceblind.py +++ b/pyfritzhome/devicetypes/fritzhomedeviceblind.py @@ -53,22 +53,29 @@ def _update_blind_from_node(self, node): pass def get_level(self): + """Get the blind level.""" return self.level def get_level_percentage(self): + """Get the blind level in percentage.""" return self.levelpercentage def set_level(self, level): + """Set the blind level.""" self._fritz.set_level(self.ain, level) def set_level_percentage(self, levelpercentage): + """Set the blind level in percentage.""" self._fritz.set_level_percentage(self.ain, levelpercentage) def set_blind_open(self): + """Open the blind.""" self._fritz.set_blind_open(self.ain) def set_blind_close(self): + """Close the blind.""" self._fritz.set_blind_close(self.ain) def set_blind_stop(self): + """Stop the blind.""" self._fritz.set_blind_stop(self.ain) diff --git a/pyfritzhome/devicetypes/fritzhomedevicebutton.py b/pyfritzhome/devicetypes/fritzhomedevicebutton.py index 71b8630..f53c487 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicebutton.py +++ b/pyfritzhome/devicetypes/fritzhomedevicebutton.py @@ -41,6 +41,7 @@ def _update_button_from_node(self, node): pass def get_button_by_ain(self, ain): + """Return the button by AIN.""" return self.buttons[ain] @@ -53,6 +54,7 @@ class FritzhomeButton(object): last_pressed = None def __init__(self, node=None): + """Create a button object.""" if node is not None: self._update_from_node(node) @@ -67,7 +69,9 @@ def _update_from_node(self, node): pass def get_node_value(self, elem, node): + """Get the node value.""" return elem.findtext(node) def get_node_value_as_int(self, elem, node) -> int: + """Get the node value as integer.""" return int(self.get_node_value(elem, node)) diff --git a/pyfritzhome/devicetypes/fritzhomeentitybase.py b/pyfritzhome/devicetypes/fritzhomeentitybase.py index d236cf6..ae7587d 100644 --- a/pyfritzhome/devicetypes/fritzhomeentitybase.py +++ b/pyfritzhome/devicetypes/fritzhomeentitybase.py @@ -19,6 +19,7 @@ class FritzhomeEntityBase(ABC): _functionsbitmask = None def __init__(self, fritz=None, node=None): + """Create an entity base object.""" if fritz is not None: self._fritz = fritz if node is not None: @@ -44,13 +45,17 @@ def _update_from_node(self, node): # XML Helpers def get_node_value(self, elem, node): + """Get the node value.""" return elem.findtext(node) def get_node_value_as_int(self, elem, node) -> int: + """Get the node value as integer.""" return int(self.get_node_value(elem, node)) def get_node_value_as_int_as_bool(self, elem, node) -> bool: + """Get the node value as boolean.""" return bool(self.get_node_value_as_int(elem, node)) def get_temp_from_node(self, elem, node): + """Get the node temp value as float.""" return float(self.get_node_value(elem, node)) / 2 diff --git a/pyfritzhome/fritzhome.py b/pyfritzhome/fritzhome.py index cfc574c..24d72f6 100644 --- a/pyfritzhome/fritzhome.py +++ b/pyfritzhome/fritzhome.py @@ -26,6 +26,7 @@ class Fritzhome(object): _templates: Dict[str, FritzhomeTemplate] = None def __init__(self, host, user, password, ssl_verify=True): + """Create a fritzhome object.""" self._host = host self._user = user self._password = password @@ -125,6 +126,7 @@ def get_prefixed_host(self): return "http://" + host def update_devices(self): + """Update the device.""" _LOGGER.info("Updating Devices ...") if self._devices is None: self._devices = {} @@ -338,12 +340,15 @@ def _set_blind_state(self, ain, state): self._aha_request("setblind", ain=ain, param={"target": state}) def set_blind_open(self, ain): + """Set the blind state to open.""" self._set_blind_state(ain, "open") def set_blind_close(self, ain): + """Set the blind state to close.""" self._set_blind_state(ain, "close") def set_blind_stop(self, ain): + """Set the blind state to stop.""" self._set_blind_state(ain, "stop") # Template-related commands @@ -358,6 +363,7 @@ def has_templates(self): return True def update_templates(self): + """Update the template.""" _LOGGER.info("Updating Templates ...") if self._templates is None: self._templates = {} diff --git a/pyfritzhome/fritzhomedevice.py b/pyfritzhome/fritzhomedevice.py index 28ec9c8..abc66af 100644 --- a/pyfritzhome/fritzhomedevice.py +++ b/pyfritzhome/fritzhomedevice.py @@ -28,6 +28,7 @@ class FritzhomeDevice( """The Fritzhome Device class.""" def __init__(self, fritz=None, node=None): + """Create a device object.""" super().__init__(fritz, node) def _update_from_node(self, node): From d8822c1a3b220a3a5bf05fedbc7ca14b155fa4d3 Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 08:23:08 +0100 Subject: [PATCH 6/9] pep257: fix docstrings ./pyfritzhome/errors.py:1 in public class `LoginError`: D101: Missing docstring in public class ./pyfritzhome/errors.py:11 in public class `InvalidError`: D101: Missing docstring in public class Signed-off-by: Heiko Thiery --- pyfritzhome/errors.py | 4 ++++ setup.cfg | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyfritzhome/errors.py b/pyfritzhome/errors.py index b8cc044..f2ba36d 100644 --- a/pyfritzhome/errors.py +++ b/pyfritzhome/errors.py @@ -1,4 +1,6 @@ class LoginError(Exception): + """The LoginError Exception.""" + def __init__(self, user): """Initialize the an loginError.""" self.user = user @@ -9,4 +11,6 @@ def __str__(self): class InvalidError(Exception): + """The InvalidError Exception.""" + pass diff --git a/setup.cfg b/setup.cfg index b9f3573..cd2dc71 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,5 +60,5 @@ omit = */doc/* [pep257] -ignore = D100,D101,D203 +ignore = D100,D203 match-dir = pyfritzhome/* From e4e0d43a43ba688d9c546323048d3ca14e66a40c Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 08:28:19 +0100 Subject: [PATCH 7/9] pep257: fix docstrings ./setup.py:1 at module level: D100: Missing docstring in public module ./pyfritzhome/fritzhomedevice.py:1 at module level: D100: Missing docstring in public module ./pyfritzhome/cli.py:1 at module level: D100: Missing docstring in public module ./pyfritzhome/fritzhome.py:1 at module level: D100: Missing docstring in public module ./pyfritzhome/errors.py:1 at module level: D100: Missing docstring in public module Signed-off-by: Heiko Thiery --- pyfritzhome/cli.py | 1 + pyfritzhome/errors.py | 2 ++ pyfritzhome/fritzhome.py | 1 + pyfritzhome/fritzhomedevice.py | 2 ++ setup.cfg | 2 +- setup.py | 2 ++ 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pyfritzhome/cli.py b/pyfritzhome/cli.py index 553216a..3fa1c70 100644 --- a/pyfritzhome/cli.py +++ b/pyfritzhome/cli.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +"""A simple CLI tool.""" # -*- coding: utf-8 -*- from __future__ import print_function diff --git a/pyfritzhome/errors.py b/pyfritzhome/errors.py index f2ba36d..9c1a803 100644 --- a/pyfritzhome/errors.py +++ b/pyfritzhome/errors.py @@ -1,3 +1,5 @@ +"""Project specific exceptions.""" + class LoginError(Exception): """The LoginError Exception.""" diff --git a/pyfritzhome/fritzhome.py b/pyfritzhome/fritzhome.py index 24d72f6..4192ce7 100644 --- a/pyfritzhome/fritzhome.py +++ b/pyfritzhome/fritzhome.py @@ -1,3 +1,4 @@ +"""The main fritzhome handling class.""" # -*- coding: utf-8 -*- from __future__ import print_function diff --git a/pyfritzhome/fritzhomedevice.py b/pyfritzhome/fritzhomedevice.py index abc66af..e4d6889 100644 --- a/pyfritzhome/fritzhomedevice.py +++ b/pyfritzhome/fritzhomedevice.py @@ -1,3 +1,5 @@ +"""Toplevel device for pyfritzhome.""" + # -*- coding: utf-8 -*- from .devicetypes import FritzhomeTemplate # noqa: F401 diff --git a/setup.cfg b/setup.cfg index cd2dc71..a560d53 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,5 +60,5 @@ omit = */doc/* [pep257] -ignore = D100,D203 +ignore = D203 match-dir = pyfritzhome/* diff --git a/setup.py b/setup.py index b694e6e..671c894 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +"""The setup of the project.""" + # -*- coding: utf-8 -*- from setuptools import setup From 484ab045988375ec1fb6511e081f1a677beb3260 Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 09:03:06 +0100 Subject: [PATCH 8/9] pydocstyle: fix tests Signed-off-by: Heiko Thiery --- pyfritzhome/cli.py | 2 +- pyfritzhome/devicetypes/fritzhomedevicealarm.py | 1 + pyfritzhome/devicetypes/fritzhomedevicebase.py | 1 + pyfritzhome/devicetypes/fritzhomedeviceblind.py | 1 + pyfritzhome/devicetypes/fritzhomedevicebutton.py | 1 + pyfritzhome/devicetypes/fritzhomedevicefeatures.py | 3 +++ pyfritzhome/devicetypes/fritzhomedevicelightbulb.py | 1 + pyfritzhome/devicetypes/fritzhomedevicepowermeter.py | 3 ++- pyfritzhome/devicetypes/fritzhomedevicerepeater.py | 1 + pyfritzhome/devicetypes/fritzhomedeviceswitch.py | 1 + pyfritzhome/devicetypes/fritzhomedevicetemperature.py | 1 + pyfritzhome/devicetypes/fritzhomedevicethermostat.py | 1 + pyfritzhome/devicetypes/fritzhomeentitybase.py | 1 + pyfritzhome/devicetypes/fritzhometemplate.py | 1 + pyfritzhome/errors.py | 1 + setup.cfg | 3 +++ 16 files changed, 21 insertions(+), 2 deletions(-) diff --git a/pyfritzhome/cli.py b/pyfritzhome/cli.py index 3fa1c70..59628ee 100644 --- a/pyfritzhome/cli.py +++ b/pyfritzhome/cli.py @@ -166,7 +166,7 @@ def template_apply(fritz, args): def main(args=None): - """The main function.""" + """Enter the main function of the CLI tool.""" parser = argparse.ArgumentParser(description="Fritz!Box Smarthome CLI tool.") parser.add_argument( "-v", action="store_true", dest="verbose", help="be more verbose" diff --git a/pyfritzhome/devicetypes/fritzhomedevicealarm.py b/pyfritzhome/devicetypes/fritzhomedevicealarm.py index f8884f3..dccca14 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicealarm.py +++ b/pyfritzhome/devicetypes/fritzhomedevicealarm.py @@ -1,3 +1,4 @@ +"""The alarm device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomedevicebase.py b/pyfritzhome/devicetypes/fritzhomedevicebase.py index e5cff34..5cd0f43 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicebase.py +++ b/pyfritzhome/devicetypes/fritzhomedevicebase.py @@ -1,3 +1,4 @@ +"""The base device class.""" # -*- coding: utf-8 -*- from __future__ import print_function diff --git a/pyfritzhome/devicetypes/fritzhomedeviceblind.py b/pyfritzhome/devicetypes/fritzhomedeviceblind.py index 91a852f..26c6b4a 100644 --- a/pyfritzhome/devicetypes/fritzhomedeviceblind.py +++ b/pyfritzhome/devicetypes/fritzhomedeviceblind.py @@ -1,3 +1,4 @@ +"""The blind device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomedevicebutton.py b/pyfritzhome/devicetypes/fritzhomedevicebutton.py index f53c487..4c4d0f4 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicebutton.py +++ b/pyfritzhome/devicetypes/fritzhomedevicebutton.py @@ -1,3 +1,4 @@ +"""The button device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomedevicefeatures.py b/pyfritzhome/devicetypes/fritzhomedevicefeatures.py index b7e0398..8b0a0f4 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicefeatures.py +++ b/pyfritzhome/devicetypes/fritzhomedevicefeatures.py @@ -1,7 +1,10 @@ +"""The feature list class.""" from enum import IntFlag class FritzhomeDeviceFeatures(IntFlag): + """The feature list class.""" + ALARM = 0x0010 UNKNOWN = 0x0020 BUTTON = 0x0020 diff --git a/pyfritzhome/devicetypes/fritzhomedevicelightbulb.py b/pyfritzhome/devicetypes/fritzhomedevicelightbulb.py index 742bedb..8bccbd9 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicelightbulb.py +++ b/pyfritzhome/devicetypes/fritzhomedevicelightbulb.py @@ -1,3 +1,4 @@ +"""The light bulb device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomedevicepowermeter.py b/pyfritzhome/devicetypes/fritzhomedevicepowermeter.py index b6ec52d..fbee6d4 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicepowermeter.py +++ b/pyfritzhome/devicetypes/fritzhomedevicepowermeter.py @@ -1,3 +1,4 @@ +"""The powermeter device class.""" # -*- coding: utf-8 -*- import logging @@ -49,7 +50,7 @@ def _update_powermeter_from_node(self, node): self.current = None def get_switch_power(self): - """The switch state.""" + """Get the switch state.""" return self._fritz.get_switch_power(self.ain) def get_switch_energy(self): diff --git a/pyfritzhome/devicetypes/fritzhomedevicerepeater.py b/pyfritzhome/devicetypes/fritzhomedevicerepeater.py index a57cdca..6642a71 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicerepeater.py +++ b/pyfritzhome/devicetypes/fritzhomedevicerepeater.py @@ -1,3 +1,4 @@ +"""The repeater device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomedeviceswitch.py b/pyfritzhome/devicetypes/fritzhomedeviceswitch.py index 80a3603..66c4165 100644 --- a/pyfritzhome/devicetypes/fritzhomedeviceswitch.py +++ b/pyfritzhome/devicetypes/fritzhomedeviceswitch.py @@ -1,3 +1,4 @@ +"""The switch device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomedevicetemperature.py b/pyfritzhome/devicetypes/fritzhomedevicetemperature.py index b0e7d40..5b241a9 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicetemperature.py +++ b/pyfritzhome/devicetypes/fritzhomedevicetemperature.py @@ -1,3 +1,4 @@ +"""The temperature device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomedevicethermostat.py b/pyfritzhome/devicetypes/fritzhomedevicethermostat.py index 5309a36..a8c8864 100644 --- a/pyfritzhome/devicetypes/fritzhomedevicethermostat.py +++ b/pyfritzhome/devicetypes/fritzhomedevicethermostat.py @@ -1,3 +1,4 @@ +"""The thermostat device class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/devicetypes/fritzhomeentitybase.py b/pyfritzhome/devicetypes/fritzhomeentitybase.py index ae7587d..274b5d1 100644 --- a/pyfritzhome/devicetypes/fritzhomeentitybase.py +++ b/pyfritzhome/devicetypes/fritzhomeentitybase.py @@ -1,3 +1,4 @@ +"""The entity base class.""" # -*- coding: utf-8 -*- from __future__ import print_function diff --git a/pyfritzhome/devicetypes/fritzhometemplate.py b/pyfritzhome/devicetypes/fritzhometemplate.py index 362860f..88dff3d 100644 --- a/pyfritzhome/devicetypes/fritzhometemplate.py +++ b/pyfritzhome/devicetypes/fritzhometemplate.py @@ -1,3 +1,4 @@ +"""The template class.""" # -*- coding: utf-8 -*- import logging diff --git a/pyfritzhome/errors.py b/pyfritzhome/errors.py index 9c1a803..6633ea8 100644 --- a/pyfritzhome/errors.py +++ b/pyfritzhome/errors.py @@ -1,5 +1,6 @@ """Project specific exceptions.""" + class LoginError(Exception): """The LoginError Exception.""" diff --git a/setup.cfg b/setup.cfg index a560d53..b824ad7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -62,3 +62,6 @@ omit = [pep257] ignore = D203 match-dir = pyfritzhome/* + +[pydocstyle] +ignore = D203,D213 From 33fbaa3439c2b48946ca713bd52a1b56962fbacf Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Fri, 6 Jan 2023 09:19:38 +0100 Subject: [PATCH 9/9] actions: add pydocstyle test step Signed-off-by: Heiko Thiery --- .github/workflows/test.yml | 5 ++++- setup.cfg | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffe98ea..4ad0a49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,12 +20,15 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: pip install pytest pytest-cov python-coveralls coverage flake8 + run: pip install pytest pytest-cov python-coveralls coverage flake8 pydocstyle - name: Lint with flake8 run: | flake8 pyfritzhome --count --show-source --statistics + - name: Run pydocstyle for analysising with Python docstring conventions. + run: pydocstyle + - name: Setup run: python setup.py install diff --git a/setup.cfg b/setup.cfg index b824ad7..5d223f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -65,3 +65,4 @@ match-dir = pyfritzhome/* [pydocstyle] ignore = D203,D213 +match-dir = pyfritzhome/*