Skip to content

Commit

Permalink
Merge 3f2475c into e3d6e49
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Sep 16, 2020
2 parents e3d6e49 + 3f2475c commit e7b5d54
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 39 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/automerge.yml
@@ -0,0 +1,27 @@
name: automerge
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: automerge
uses: "pascalgn/automerge-action@f81beb99aef41bb55ad072857d43073fba833a98"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
62 changes: 31 additions & 31 deletions .pre-commit-config.yaml
@@ -1,32 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
- id: check-ast
- repo: https://github.com/ambv/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
hooks:
- id: blacken-docs
additional_dependencies: [black==19.10b0]
- repo: https://github.com/asottile/pyupgrade
rev: v1.25.2
hooks:
- id: pyupgrade
args: ['--py36-plus']
- repo: https://github.com/timothycrosley/isort
rev: 5.4.2
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
- id: check-ast
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
hooks:
- id: blacken-docs
additional_dependencies: [black==20.8b1]
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
hooks:
- id: pyupgrade
args: ['--py37-plus']
- repo: https://github.com/timothycrosley/isort
rev: 5.5.2
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
6 changes: 3 additions & 3 deletions demo.py
Expand Up @@ -35,8 +35,8 @@ def poll(args):
backend = _get_backend(args)
poller = MiFloraPoller(args.mac, backend)
print("Getting data from Mi Flora")
print("FW: {}".format(poller.firmware_version()))
print("Name: {}".format(poller.name()))
print(f"FW: {poller.firmware_version()}")
print(f"Name: {poller.name()}")
print("Temperature: {}".format(poller.parameter_value(MI_TEMPERATURE)))
print("Moisture: {}".format(poller.parameter_value(MI_MOISTURE)))
print("Light: {}".format(poller.parameter_value(MI_LIGHT)))
Expand Down Expand Up @@ -106,7 +106,7 @@ def main():
"--backend", choices=["gatttool", "bluepy", "pygatt"], default="gatttool"
)
parser.add_argument("-v", "--verbose", action="store_const", const=True)
subparsers = parser.add_subparsers(help="sub-command help",)
subparsers = parser.add_subparsers(help="sub-command help")

parser_poll = subparsers.add_parser("poll", help="poll data from a sensor")
parser_poll.add_argument("mac", type=valid_miflora_mac)
Expand Down
4 changes: 1 addition & 3 deletions miflora/miflora_poller.py
Expand Up @@ -49,9 +49,7 @@ def format_bytes(raw_data):


class MiFloraPoller:
""""
A class to read data from Mi Flora plant sensors.
"""
"""A class to read data from Mi Flora plant sensors."""

def __init__(self, mac, backend, cache_timeout=600, adapter="hci0"):
"""
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Expand Up @@ -7,7 +7,7 @@

def readme():
"""Load the readme file."""
with open("README.md", "r") as readme_file:
with open("README.md") as readme_file:
return readme_file.read()


Expand Down Expand Up @@ -35,6 +35,8 @@ def get_version_and_cmdclass(package_path):
url="https://github.com/basnijholt/miflora",
author="Daniel Matuschek",
author_email="daniel@matuschek.net",
maintainer="Bas Nijholt",
maintainer_email="bas@nijho.lt",
license="MIT",
python_requires=">=3.6",
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion test/helper.py
Expand Up @@ -169,7 +169,7 @@ def _read_history(self):

if self.history_data is None:
raise ValueError("history not set")
(cmd, index,) = unpack("<Bh", self._history_control)
(cmd, index) = unpack("<Bh", self._history_control)
if cmd == 0xA0:
return self.history_info
elif cmd == 0xA1:
Expand Down

0 comments on commit e7b5d54

Please sign in to comment.