Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve philips.light.mono1 support #1269

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions miio/philips_bulb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

MODEL_PHILIPS_LIGHT_BULB = "philips.light.bulb"
MODEL_PHILIPS_LIGHT_HBULB = "philips.light.hbulb"
MODEL_PHILIPS_LIGHT_MONO1 = "philips.light.mono1"
MODEL_PHILIPS_ZHIRUI_DOWNLIGHT = "philips.light.downlight"
MODEL_PHILIPS_CANDLE = "philips.light.candle"
MODEL_PHILIPS_CANDLE2 = "philips.light.candle2"
Expand All @@ -21,6 +22,13 @@

AVAILABLE_PROPERTIES = {
MODEL_PHILIPS_LIGHT_HBULB: AVAILABLE_PROPERTIES_COMMON + ["bri"],
MODEL_PHILIPS_LIGHT_MONO1: [
"power",
"bright",
"notifystatus",
"notifytime",
"scene_num",
],
MODEL_PHILIPS_LIGHT_BULB: AVAILABLE_PROPERTIES_COLORTEMP,
MODEL_PHILIPS_ZHIRUI_DOWNLIGHT: AVAILABLE_PROPERTIES_COLORTEMP,
MODEL_PHILIPS_CANDLE: AVAILABLE_PROPERTIES_COLORTEMP,
Expand Down Expand Up @@ -65,11 +73,15 @@ def color_temperature(self) -> Optional[int]:
def scene(self) -> Optional[int]:
if "snm" in self.data:
return self.data["snm"]
if "scene_num" in self.data:
return self.data["scene_num"]
return None

@property
def delay_off_countdown(self) -> int:
return self.data["dv"]
def delay_off_countdown(self) -> Optional[int]:
if "dv" in self.data:
return self.data["dv"]
return None


class PhilipsWhiteBulb(Device):
Expand Down