-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error detection and logging for properties in the thermostat
- Loading branch information
Joshua Mulliken
committed
May 17, 2021
1 parent
62a5ec7
commit 6a5be46
Showing
3 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = [email protected] | ||
description = Python client for private Wyze API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,15 @@ | |
# of the attached license. You should have received a copy of | ||
# the license with this file. If not, please write to: | ||
# [email protected] to receive a copy | ||
|
||
import logging | ||
import re | ||
|
||
from typing import Any, Optional, List, Tuple | ||
from .base_client import BaseClient | ||
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters