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

Add Philips Moonlight Bedside Lamp support #18496

Conversation

syssi
Copy link
Member

@syssi syssi commented Nov 15, 2018

Description:

  • Power (on, off)
  • Brightness
  • Color temperature (588-153 mireds / 1700K-6500K)
  • Scene (1, 2, 3, 4)
  • Attributes
    • model
    • scene
    • sleep_assistant
    • sleep_off_time
    • total_assistant_sleep_time
    • brand_sleep
    • brand

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7589

@@ -1,5 +1,5 @@
"""
Support for Xiaomi Philips Lights (LED Ball & Ceiling Lamp, Eyecare Lamp 2).
Support for Xiaomi Philips Lights (LED Ball & Ceiling Lamp, Eyecare Lamp 2, Bedside Lamp).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (90 > 79 characters)

Copy link
Member

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can be merged after the documentation part is done.

def _get_hs(rgb: int):
blue = rgb & 0xff
green = (rgb >> 8) & 0xff
red = (rgb >> 16) & 0xff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go preferably to python-miio (this can be then reused by the yeelight plugin, at least).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ATTR_SLEEP_OFF_TIME = 'sleep_off_time'
ATTR_TOTAL_ASSISTANT_SLEEP_TIME = 'total_assistant_sleep_time'
ATTR_BRAND_SLEEP = 'brand_sleep'
ATTR_BRAND = 'brand'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be documented (although I saw that it's a TBD). What does brand mean in this context?

Copy link
Member Author

@syssi syssi Nov 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as home-assistant/home-assistant.io#7498 gets merged I will extend the docs.

@property
def max_mireds(self):
"""Return the warmest color_temp that this light supports."""
return 588
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if these should also be defined in python-miio (in kelvin, though). What do you think, does it make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We should provide specs and features in the long run by python-miio.

@rytilahti
Copy link
Member

rytilahti commented Nov 23, 2018

@syssi your call, do you want to wait for the next python-miio release to simplify the RGB setting or just merge this now? As #17558 depends on a new release (as well as support for several other vacuum types), I think it would make sense to make a new release and update this, too.

@syssi
Copy link
Member Author

syssi commented Nov 24, 2018

Lets wait for the next python-miio release.

@syssi syssi force-pushed the feature/xiaomi-miio-philips-moonlight-support branch from 6d9a00b to 27c9033 Compare December 8, 2018 08:50
@rytilahti
Copy link
Member

Thanks!

@rytilahti rytilahti merged commit 2134331 into home-assistant:dev Dec 8, 2018
@ghost ghost removed the in progress label Dec 8, 2018
thibmaek added a commit to thibmaek/home-assistant that referenced this pull request Dec 10, 2018
…into feature/nmbs-sensor

* 'dev' of https://github.com/home-assistant/home-assistant: (325 commits)
  Update translations
  Updated frontend to 20181210.0
  Lovelace using storage (home-assistant#19101)
  Update pygtfs to upstream's 0.1.5 (home-assistant#19151)
  Update radiotherm to 2.0.0 and handle change in tstat error detection (home-assistant#19107)
  Upgrade sphinx-autodoc-typehints to 1.5.2 (home-assistant#19140)
  Update geizhals dependency (home-assistant#19152)
  Upgrade mypy to 0.650 (home-assistant#19150)
  Upgrade upcloud-api to 0.4.3
  Upgrade youtube_dl to 2018.12.03 (home-assistant#19139)
  Upgrade slacker to 0.12.0
  Add code support for iAlarm (home-assistant#19124)
  Fixed doorbird config without events (empty list) (home-assistant#19121)
  Remove marking device tracker stale if state is stale (home-assistant#19133)
  Update Google Assistant services description and request sync timeout (home-assistant#19113)
  update edp_redy version (home-assistant#19078)
  Add Philips Moonlight Bedside Lamp support (home-assistant#18496)
  Upgrade Mill library (home-assistant#19117)
  Don't avoid async_schedule_update_ha_state by returning false (home-assistant#19102)
  Fix the Xiaomi Aqara Cube rotate event of the LAN protocol 2.0 (Closes: home-assistant#18199) (home-assistant#19104)
  ...
@balloob balloob mentioned this pull request Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants