diff --git a/setup.cfg b/setup.cfg index 468275b..5d1b76a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = wyzeapy -version = 0.0.23-beta.7 +version = 0.0.23-beta.8 author = Mulliken LLC author_email = joshua@mulliken.net description = Python client for private Wyze API diff --git a/src/wyzeapy/client.py b/src/wyzeapy/client.py index 2f7b2a5..b9a9da6 100644 --- a/src/wyzeapy/client.py +++ b/src/wyzeapy/client.py @@ -3,7 +3,7 @@ # of the attached license. You should have received a copy of # the license with this file. If not, please write to: # joshua@mulliken.net to receive a copy - +import logging import re from typing import Any, Optional, List, Tuple @@ -11,6 +11,7 @@ from .exceptions import ActionNotSupported from .types import ThermostatProps, Device, DeviceTypes, PropertyIDs, Event, Group +_LOGGER = logging.getLogger(__name__) class Client: def __init__(self, email, password): @@ -201,8 +202,8 @@ def get_thermostat_info(self, device) -> List[Tuple[ThermostatProps, Any]]: try: prop = ThermostatProps(property) device_props.append((prop, properties[property])) - except AttributeError as e: - print(e) + except ValueError as e: + _LOGGER.debug(f"{e} with value {properties[property]}") return device_props diff --git a/src/wyzeapy/types.py b/src/wyzeapy/types.py index d1d75a3..83a9a5c 100644 --- a/src/wyzeapy/types.py +++ b/src/wyzeapy/types.py @@ -91,6 +91,8 @@ class ThermostatProps(Enum): W_LON = "w_lon" DEV_HOLD = "dev_hold" TEMP_UNIT = "temp_unit" + ASW_HOLD = "asw_hold" + class ResponseCodes(Enum):