Skip to content

Commit

Permalink
Merge branch 'release/v7.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jabesq committed Jan 2, 2023
2 parents 434658f + e185f1e commit 6cbd8ee
Show file tree
Hide file tree
Showing 21 changed files with 920 additions and 527 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.4.0
with:
python-version: 3.8
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
ref: development
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.4.0
with:
python-version: 3.8
- name: Install dependencies
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
strategy:
max-parallel: 1
matrix:
python-version: [3.10.0]
python-version: [3.10.8]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.4.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -39,12 +39,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.10.0]
python-version: [3.10.8]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.4.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -63,12 +63,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9, 3.10.0]
python-version: [3.8, 3.9, 3.10.8]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v4.4.0
with:
python-version: ${{ matrix.python-version }}
- name: Run tests with tox
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ ci:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]
exclude: "external_src/int-tools"

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.3.0
rev: v2.4.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
Expand All @@ -26,19 +26,19 @@ repos:
- id: yesqa

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v0.991
hooks:
- id: mypy
name: mypy
Expand All @@ -47,7 +47,7 @@ repos:
- types-requests

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 # Use the ref you want to point at
rev: v4.4.0 # Use the ref you want to point at
hooks:
- id: check-ast
- id: no-commit-to-branch
Expand All @@ -63,11 +63,11 @@ repos:
- id: check-toml

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4 # pick a git hash / tag to point to
rev: 6.0.0 # pick a git hash / tag to point to
hooks:
- id: flake8
exclude: (otp)
additional_dependencies: [flake8-typing-imports==1.11.0]
additional_dependencies: [flake8-typing-imports==1.14.0]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

-

## [7.5.0]

### Added

- Add NLAS - wireless batteryless scene switch device type
- Add BNEU, EBU, NLDD, NLAO, NLLF, NLUO, NLUP, Z3L, NLTS, NLUF

### Fixed

- Update Legrand and BTicino devices
- Fix broken temperature setter when OTM is in the setup

## [7.4.0]

### Added

- Add NLUF device stub
- Add TPSRS Somfy shutters


### Changed

Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pytest-mock = "*"
requests-mock = "*"
tox = ">=3.25"
twine = "*"
no-implicit-optional = "*"

[packages]
requests = "*"
Expand Down
1,151 changes: 686 additions & 465 deletions Pipfile.lock

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions fixtures/homesdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"12:34:56:00:f1:62",
"12:34:56:10:f1:66",
"12:34:56:00:e3:9b",
"0009999992"
"0009999992",
"0009999993"
]
},
{
Expand Down Expand Up @@ -174,7 +175,7 @@
"name": "module iDiamant",
"setup_date": 1562262465,
"room_id": "222452125",
"modules_bridged": ["0009999992"]
"modules_bridged": ["0009999992", "0009999993"]
},
{
"id": "0009999992",
Expand All @@ -184,6 +185,14 @@
"room_id": "3688132631",
"bridge": "12:34:56:30:d5:d4"
},
{
"id": "0009999993",
"type": "NBO",
"name": "Bubendorff blind",
"setup_date": 1594132017,
"room_id": "3688132631",
"bridge": "12:34:56:30:d5:d4"
},
{
"id": "12:34:56:80:bb:26",
"type": "NAMain",
Expand Down Expand Up @@ -806,4 +815,3 @@
"time_exec": 0.056135892868042,
"time_server": 1559171003
}

13 changes: 12 additions & 1 deletion fixtures/homestatus_91763b24c43d3e344f424e8b.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@
"reachable": true,
"bridge": "12:34:56:30:d5:d4"
},
{
"id": "0009999993",
"type": "NBO",
"current_position": 0,
"target_position": 0,
"target_position:step": 100,
"firmware_revision": 22,
"rf_strength": 0,
"last_seen": 1671395511,
"reachable": true,
"bridge": "12:34:56:30:d5:d4"
},
{
"id": "12:34:56:00:86:99",
"type": "NACamDoorTag",
Expand Down Expand Up @@ -347,4 +359,3 @@
}
}
}

22 changes: 11 additions & 11 deletions src/pyatmo/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_light_state(self, camera_id: str) -> str | None:

return camera_data.get("light_mode_status")

def persons_at_home(self, home_id: str = None) -> list:
def persons_at_home(self, home_id: str | None = None) -> list:
"""Return a list of known persons who are currently at home."""
home_data = self.homes.get(home_id, {})
return [
Expand Down Expand Up @@ -528,9 +528,9 @@ def _check_url(self, url: str) -> str | None:
def set_state(
self,
camera_id: str,
home_id: str = None,
floodlight: str = None,
monitoring: str = None,
home_id: str | None = None,
floodlight: str | None = None,
monitoring: str | None = None,
) -> bool:
"""Turn camera (light) on/off.
Expand Down Expand Up @@ -570,7 +570,7 @@ def set_state(
LOG.debug("%s", resp)
return True

def set_persons_home(self, home_id: str, person_ids: list[str] = None):
def set_persons_home(self, home_id: str, person_ids: list[str] | None = None):
"""Mark persons as home."""
post_params: dict[str, str | list] = {"home_id": home_id}
if person_ids:
Expand Down Expand Up @@ -619,8 +619,8 @@ def get_profile_image(
def update_events(
self,
home_id: str,
event_id: str = None,
device_type: str = None,
event_id: str | None = None,
device_type: str | None = None,
) -> None:
"""Update the list of events."""
if not (event_id or device_type):
Expand Down Expand Up @@ -691,9 +691,9 @@ async def _async_update_all_camera_urls(self) -> None:
async def async_set_state(
self,
camera_id: str,
home_id: str = None,
floodlight: str = None,
monitoring: str = None,
home_id: str | None = None,
floodlight: str | None = None,
monitoring: str | None = None,
) -> bool:
"""Turn camera (light) on/off.
Expand Down Expand Up @@ -773,7 +773,7 @@ async def _async_check_url(self, url: str) -> str | None:
async def async_set_persons_home(
self,
home_id: str,
person_ids: list[str] = None,
person_ids: list[str] | None = None,
):
"""Mark persons as home."""
post_params: dict[str, str | list] = {"home_id": home_id}
Expand Down
3 changes: 3 additions & 0 deletions src/pyatmo/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ def is_valid_schedule(self, schedule_id: str) -> bool:
"""Check if valid schedule."""
return schedule_id in self.schedules

def has_otm(self) -> bool:
return any("OTM" in room.device_types for room in self.rooms.values())

def get_hg_temp(self) -> float | None:
"""Return frost guard temperature value for given home."""
if (schedule := self.get_selected_schedule()) is None:
Expand Down
23 changes: 22 additions & 1 deletion src/pyatmo/modules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
"""Expose submodules."""
from .base_class import Place
from .bticino import BNCX, BNDL, BNSL
from .bticino import BNCX, BNDL, BNEU, BNSL
from .idiamant import NBG, NBO, NBR, NBS
from .legrand import (
EBU,
NLAO,
NLAS,
NLC,
NLD,
NLDD,
NLE,
NLF,
NLFE,
NLFN,
NLG,
NLIS,
NLL,
NLLF,
NLLM,
NLLV,
NLM,
Expand All @@ -23,9 +28,13 @@
NLPS,
NLPT,
NLT,
NLTS,
NLUF,
NLUI,
NLUO,
NLUP,
NLV,
Z3L,
NLunknown,
)
from .module import Camera, Dimmer, Module, Shutter, Switch
Expand All @@ -52,10 +61,12 @@
PublicWeatherArea,
)
from .smarther import BNS
from .somfy import TPSRS

__all__ = [
"BNCX",
"BNDL",
"BNEU",
"BNS",
"BNSL",
"Camera",
Expand All @@ -81,6 +92,7 @@
"NIS",
"NLC",
"NLD",
"NLDD",
"NLE",
"NLF",
"NLFE",
Expand All @@ -101,8 +113,14 @@
"NLT",
"NLUF",
"NLUI",
"NLAO",
"NLLF",
"NLUO",
"NLunknown",
"NLUP",
"NLV",
"EBU",
"Z3L",
"NOC",
"NRV",
"NSD",
Expand All @@ -112,4 +130,7 @@
"PublicWeatherArea",
"Shutter",
"Switch",
"TPSRS",
"NLAS",
"NLTS",
]
6 changes: 5 additions & 1 deletion src/pyatmo/modules/bticino.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ class BNSL(Switch): # pylint: disable=too-many-ancestors


class BNCX(Module):
"""BTicino"""
"""BTicino internal panel = gateway."""


class BNEU(Module):
"""BTicino external unit."""
Loading

0 comments on commit 6cbd8ee

Please sign in to comment.