Skip to content

Commit ceff89a

Browse files
authored
Merge 33fbaa3 into 9c5a2ed
2 parents 9c5a2ed + 33fbaa3 commit ceff89a

23 files changed

+72
-6
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ jobs:
2020
python-version: ${{ matrix.python-version }}
2121

2222
- name: Install dependencies
23-
run: pip install pytest pytest-cov python-coveralls coverage flake8
23+
run: pip install pytest pytest-cov python-coveralls coverage flake8 pydocstyle
2424

2525
- name: Lint with flake8
2626
run: |
2727
flake8 pyfritzhome --count --show-source --statistics
2828
29+
- name: Run pydocstyle for analysising with Python docstring conventions.
30+
run: pydocstyle
31+
2932
- name: Setup
3033
run: python setup.py install
3134

pyfritzhome/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Init file for pyfritzhome."""
2+
13
from .errors import InvalidError, LoginError
24
from .fritzhome import Fritzhome
35
from .fritzhomedevice import FritzhomeDevice

pyfritzhome/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
"""A simple CLI tool."""
23
# -*- coding: utf-8 -*-
34

45
from __future__ import print_function
@@ -165,7 +166,7 @@ def template_apply(fritz, args):
165166

166167

167168
def main(args=None):
168-
"""The main function."""
169+
"""Enter the main function of the CLI tool."""
169170
parser = argparse.ArgumentParser(description="Fritz!Box Smarthome CLI tool.")
170171
parser.add_argument(
171172
"-v", action="store_true", dest="verbose", help="be more verbose"

pyfritzhome/devicetypes/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Init file for the device types."""
2+
13
from .fritzhomedevicealarm import FritzhomeDeviceAlarm
24
from .fritzhomedevicebutton import FritzhomeDeviceButton
35
from .fritzhomedevicepowermeter import FritzhomeDevicePowermeter

pyfritzhome/devicetypes/fritzhomedevicealarm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""The alarm device class."""
12
# -*- coding: utf-8 -*-
23

34
import logging

pyfritzhome/devicetypes/fritzhomedevicebase.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""The base device class."""
12
# -*- coding: utf-8 -*-
23

34
from __future__ import print_function

pyfritzhome/devicetypes/fritzhomedeviceblind.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""The blind device class."""
12
# -*- coding: utf-8 -*-
23

34
import logging
@@ -53,22 +54,29 @@ def _update_blind_from_node(self, node):
5354
pass
5455

5556
def get_level(self):
57+
"""Get the blind level."""
5658
return self.level
5759

5860
def get_level_percentage(self):
61+
"""Get the blind level in percentage."""
5962
return self.levelpercentage
6063

6164
def set_level(self, level):
65+
"""Set the blind level."""
6266
self._fritz.set_level(self.ain, level)
6367

6468
def set_level_percentage(self, levelpercentage):
69+
"""Set the blind level in percentage."""
6570
self._fritz.set_level_percentage(self.ain, levelpercentage)
6671

6772
def set_blind_open(self):
73+
"""Open the blind."""
6874
self._fritz.set_blind_open(self.ain)
6975

7076
def set_blind_close(self):
77+
"""Close the blind."""
7178
self._fritz.set_blind_close(self.ain)
7279

7380
def set_blind_stop(self):
81+
"""Stop the blind."""
7482
self._fritz.set_blind_stop(self.ain)

pyfritzhome/devicetypes/fritzhomedevicebutton.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""The button device class."""
12
# -*- coding: utf-8 -*-
23

34
import logging
@@ -41,6 +42,7 @@ def _update_button_from_node(self, node):
4142
pass
4243

4344
def get_button_by_ain(self, ain):
45+
"""Return the button by AIN."""
4446
return self.buttons[ain]
4547

4648

@@ -53,6 +55,7 @@ class FritzhomeButton(object):
5355
last_pressed = None
5456

5557
def __init__(self, node=None):
58+
"""Create a button object."""
5659
if node is not None:
5760
self._update_from_node(node)
5861

@@ -67,7 +70,9 @@ def _update_from_node(self, node):
6770
pass
6871

6972
def get_node_value(self, elem, node):
73+
"""Get the node value."""
7074
return elem.findtext(node)
7175

7276
def get_node_value_as_int(self, elem, node) -> int:
77+
"""Get the node value as integer."""
7378
return int(self.get_node_value(elem, node))

pyfritzhome/devicetypes/fritzhomedevicefeatures.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
"""The feature list class."""
12
from enum import IntFlag
23

34

45
class FritzhomeDeviceFeatures(IntFlag):
6+
"""The feature list class."""
7+
58
ALARM = 0x0010
69
UNKNOWN = 0x0020
710
BUTTON = 0x0020

pyfritzhome/devicetypes/fritzhomedevicelightbulb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""The light bulb device class."""
12
# -*- coding: utf-8 -*-
23

34
import logging

0 commit comments

Comments
 (0)