Skip to content

Commit

Permalink
Merge branch 'release/1.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed May 22, 2022
2 parents 733f8d9 + b972493 commit 2144f9c
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/new_device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: New device
about: Report new Beward device
title: ''
labels: 'enhancement'
assignees: ''

---

<!-- Please READ THIS FIRST
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
Always check if there is a similar feature request already do avoid duplicates.
If there is a similar FR already, please add comments if you have other thoughts about the solution.
-->

Device ID as it was detected by `py-beward` library:

Web-link to official device's description:
2 changes: 1 addition & 1 deletion .github/workflows/py-dead-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
echo "package=$(ls -F | grep \/$ | grep -v "bin\|examples\|tests" | sed -n "s/\///g;1p")" >> $GITHUB_ENV
- name: "Set up Python"
uses: actions/setup-python@v3.1.0
uses: actions/setup-python@v3.1.2
with:
python-version: '3.8'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/py-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
echo "package=`ls -F | grep \/$ | grep -v "bin\|examples\|tests" | sed -n "s/\///g;1p"`" >> $GITHUB_ENV
- name: "Set up Python"
uses: actions/setup-python@v3.1.0
uses: actions/setup-python@v3.1.2
with:
python-version: '3.10'

Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
uses: actions/checkout@master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3.1.0
uses: actions/setup-python@v3.1.2
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
echo "is_prerelease=`if echo ${{ github.ref }} | grep -qE "(a|b|rc|dev)"; then echo true; else echo false; fi`" >> $GITHUB_ENV
- name: "Set up Python"
uses: actions/setup-python@v3.1.0
uses: actions/setup-python@v3.1.2
with:
python-version: '3.x'

Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
uses: actions/checkout@master

- name: "Set up Python"
uses: actions/setup-python@v3.1.0
uses: actions/setup-python@v3.1.2
with:
python-version: '3.x'

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ The original setup of this library is by [Andrey "Limych" Khrolenok](https://git

For a full list of all authors and contributors, check [the contributor's page][contributors].

This project was created and is updated using the [Py-Blueprint template](https://github.com/Limych/py-blueprint). You can use this template to maintain your own projects.

## License

creative commons Attribution-NonCommercial-ShareAlike 4.0 International License
Expand Down
14 changes: 11 additions & 3 deletions beward/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
"""Python API for Beward Cameras and Doorbells."""
Expand All @@ -21,7 +21,12 @@

# Will be parsed by setup.py to determine package metadata
from beward.camera import BewardCamera
from beward.const import BEWARD_CAMERA, BEWARD_DOORBELL, STARTUP_MESSAGE
from beward.const import (
BEWARD_CAMERA,
BEWARD_DOORBELL,
NEW_DEVICE_ISSUE_URL,
STARTUP_MESSAGE,
)
from beward.core import BewardGeneric
from beward.doorbell import BewardDoorbell

Expand Down Expand Up @@ -187,7 +192,10 @@ def factory(host_ip: str, username: str, password: str, **kwargs):
dev_type = bwd.get_device_type(model)

if dev_type is None:
raise ValueError(f'Unknown device "{model}"')
raise ValueError(
f'Unknown device "{model}". '
f"Please, open new issue here: {NEW_DEVICE_ISSUE_URL}"
)

inst = None

Expand Down
2 changes: 1 addition & 1 deletion beward/camera.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
"""Beward camera controller."""
Expand Down
8 changes: 5 additions & 3 deletions beward/const.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Copyright (c) 2019-2021, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
"""Constants."""

# Base library constants
NAME = "Beward Client"
VERSION = "1.1.5"
VERSION = "1.1.6"
AUTHOR = 'Andrey "Limych" Khrolenok <andrey@khrolenok.ru>'
LICENSE = "Creative Commons BY-NC-SA License"
WEBSITE = "https://github.com/Limych/py-beward"
ISSUE_URL = "https://github.com/Limych/py-beward/issues"
NEW_DEVICE_ISSUE_URL = "https://github.com/Limych/py-beward/issues/new?assignees=&labels=enhancement&template=new_device.md&title="

STARTUP_MESSAGE = f"""
-------------------------------------------------------------------
Expand Down Expand Up @@ -39,5 +40,6 @@
# Beward models
BEWARD_MODELS = {
BEWARD_CAMERA: "B102S",
BEWARD_DOORBELL: "ALP-600 DK103 DK103M DS03M DS05M(P) DS06M DS06A(P) DSN06PS S06A S06M",
BEWARD_DOORBELL: "ALP-600 DK103 DK103M DKS20210 DS03M DS05M(P) DS06M DS06A(P) "
"DSN06PS S06A S06M",
}
5 changes: 4 additions & 1 deletion beward/core.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) 2019-2021, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
"""Beward devices controller core."""

import logging
import re
import socket
import threading
from datetime import datetime
Expand Down Expand Up @@ -34,6 +35,8 @@ def get_device_type(model: Optional[str]) -> Optional[str]:
if not model:
return None

model = re.sub(r"_rev.+$", "", model)

for dev_type, models in BEWARD_MODELS.items():
if model in models.split():
return dev_type
Expand Down
2 changes: 1 addition & 1 deletion beward/doorbell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
"""Beward doorbell controller."""
Expand Down
2 changes: 1 addition & 1 deletion beward/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Copyright (c) 2019-2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
"""Utilities."""
Expand Down

0 comments on commit 2144f9c

Please sign in to comment.