Skip to content

Commit

Permalink
Release v8.0.2 (#485)
Browse files Browse the repository at this point in the history
* add missing device type mapping for NIS (#476)

* Add power data to NLPD entities (#477)

* Add missing NLFE Legrand dimmer switch

* clean up

* Add shutter capabilities to BNAB, BNAS and BNMS (#484)

* fix: update name prefixing (#483)

---------

Signed-off-by: Tobias Sauerwein <[email protected]>
  • Loading branch information
cgtobi authored Dec 26, 2023
1 parent 484dd90 commit 9185311
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 40 deletions.
42 changes: 9 additions & 33 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

-

## [8.0.1]

### Added

- NLFE Legrand dimmer switch evolution

### Changed

-

### Deprecated

-

### Removed

-
## [8.0.2]

### Fixed

-
- Duplicates in entity names (https://github.com/home-assistant/core/issues/88792)
- Add shutter capabilities to BNAB, BNAS and BNMS (https://github.com/home-assistant/core/issues/106392)

### Security
## [8.0.1]

-
### Added

- NLFE Legrand dimmer switch evolution

## [8.0.0]

Expand All @@ -69,22 +56,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add power data to NLPD entities

### Deprecated

-

### Removed

- deprecated code

### Fixed

-

### Security

-

## [7.6.0]

### Added
Expand Down Expand Up @@ -368,7 +343,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fix crash when station name is not contained in the backend data

[unreleased]: https://github.com/jabesq/pyatmo/compare/v8.0.1...HEAD
[unreleased]: https://github.com/jabesq/pyatmo/compare/v8.0.2...HEAD
[8.0.2]: https://github.com/jabesq/pyatmo/compare/v8.0.1...v8.0.2
[8.0.1]: https://github.com/jabesq/pyatmo/compare/v8.0.0...v8.0.1
[8.0.0]: https://github.com/jabesq/pyatmo/compare/v7.6.0...v8.0.0
[7.6.0]: https://github.com/jabesq/pyatmo/compare/v7.5.0...v7.6.0
Expand Down
10 changes: 9 additions & 1 deletion src/pyatmo/modules/base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ def default(key: str, val: Any) -> Any:
return lambda x, _: x.get(key, val)


def update_name(name: str, pre_fix: str) -> str:
"""Remove duplicates from string."""

if name.startswith(pre_fix):
return name
return f"{pre_fix} {name}"


class EntityBase:
"""Base class for Netatmo entities."""

Expand Down Expand Up @@ -62,7 +70,7 @@ def update_topology(self, raw_data: RawData) -> None:
and self.bridge in self.home.modules
and getattr(self, "device_category") == "weather"
):
self.name = f"{self.home.modules[self.bridge].name} {self.name}"
self.name = update_name(self.name, self.home.modules[self.bridge].name)

def _update_attributes(self, raw_data: RawData) -> None:
"""Update attributes."""
Expand Down
10 changes: 5 additions & 5 deletions src/pyatmo/modules/bticino.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import logging

from pyatmo.modules.module import Dimmer, Module, Switch
from pyatmo.modules.module import Dimmer, Module, Shutter, Switch

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -32,20 +32,20 @@ class BNXM(Module):
"""BTicino X meter."""


class BNMS(Module):
class BNMS(Shutter):
"""BTicino motorized shade."""


class BNAS(Module):
class BNAS(Shutter):
"""BTicino automatic shutter."""


class BNAB(Module):
class BNAB(Shutter):
"""BTicino automatic blind."""


class BNMH(Module):
"""BTicino automatic blind."""
"""BTicino MyHome server."""


class BNTH(Module):
Expand Down
2 changes: 1 addition & 1 deletion src/pyatmo/modules/device_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class DeviceType(str, Enum):
BNMS = "BNMS" # motorized shade
BNAS = "BNAS" # automatic shutter
BNAB = "BNAB" # automatic blind
BNMH = "BNMH" # automatic blind
BNMH = "BNMH" # MyHome server
BNTH = "BNTH" # thermostat
BNFC = "BNFC" # fan coil
BNTR = "BNTR" # radiator
Expand Down

0 comments on commit 9185311

Please sign in to comment.