Skip to content

Commit fedcaef

Browse files
committed
Add CRAI suggestions
1 parent d030657 commit fedcaef

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

airos/airos8data.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _check_and_log_unknown_enum_value(
2121
value = data_dict.get(key)
2222
if value is not None and isinstance(value, str):
2323
if value not in [e.value for e in enum_class]:
24-
logging.warning(
24+
logger.warning(
2525
"Unknown value '%s' for %s.%s. Please report at "
2626
"https://github.com/CoMPaTech/python-airos/issues so we can add support.",
2727
value,
@@ -252,6 +252,12 @@ class Remote:
252252
airview: int
253253
service: ServiceTime
254254

255+
@classmethod
256+
def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
257+
"""Pre-deserialize hook for Wireless."""
258+
_check_and_log_unknown_enum_value(d, "mode", WirelessMode, "Wireless", "mode")
259+
return d
260+
255261

256262
@dataclass
257263
class Station:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "airos"
7-
version = "0.1.4"
7+
version = "0.1.5"
88
license = "MIT"
99
description = "Ubiquity airOS module(s) for Python 3."
1010
readme = "README.md"

0 commit comments

Comments
 (0)