Skip to content

Commit

Permalink
Raise WyzeFeatureNotSupportedException when accessing color property …
Browse files Browse the repository at this point in the history
…for standard bulb [#5]
  • Loading branch information
Shaun Tarves committed Apr 23, 2021
1 parent deb8479 commit f8fd091
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wyze_sdk/api/devices/bulbs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, timedelta
from datetime import timedelta
from typing import Optional, Sequence, Union

from wyze_sdk.errors import WyzeFeatureNotSupportedError
Expand Down
7 changes: 6 additions & 1 deletion wyze_sdk/models/devices/bulbs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import (Optional, Set, Union)

from wyze_sdk.errors import WyzeFeatureNotSupportedError
from wyze_sdk.models import (PropDef, show_unknown_key_warning)
from wyze_sdk.models.devices import (AbstractWirelessNetworkedDevice, DeviceProp, DeviceProps, SwitchableMixin)

Expand Down Expand Up @@ -124,6 +125,10 @@ def power_loss_recovery(self, value: Union[int, DeviceProp]):
value = DeviceProp(definition=BulbProps.power_loss_recovery, value=value)
self._power_loss_recovery = value

@property
def color(self) -> str:
raise WyzeFeatureNotSupportedError("color")

@classmethod
def parse(cls, device: Union[dict, "Bulb"]) -> Optional["Bulb"]:
if device is None:
Expand Down Expand Up @@ -165,7 +170,7 @@ def __init__(

@property
def color(self) -> str:
return "" if self._color is None else self._color.value
return None if self._color is None else self._color.value

@color.setter
def color(self, value: Union[str, DeviceProp]):
Expand Down

0 comments on commit f8fd091

Please sign in to comment.