Skip to content

Commit

Permalink
add _missing_ function to DeviceType class (#462)
Browse files Browse the repository at this point in the history
* add _missing_ function to DeviceType class

---------

Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
  • Loading branch information
jlabrous and cgtobi authored Oct 21, 2023
1 parent 73903a4 commit ba090e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pyatmo/modules/device_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ class DeviceType(str, Enum):

# pylint: enable=C0103

@classmethod
def _missing_(cls, key):
"""Handle unknown device types."""

msg = f"{key} device is unknown"
LOG.warning(msg)
return DeviceType.NLunknown


class DeviceCategory(str, Enum):
"""Class to represent Netatmo device types."""
Expand Down

0 comments on commit ba090e3

Please sign in to comment.