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

Provide an individual color temperature range per Yeelight model #14083

Closed
wants to merge 2 commits into from

Conversation

syssi
Copy link
Member

@syssi syssi commented Apr 25, 2018

Description:

Related issue (if applicable): fixes #13785

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

Example entry for configuration.yaml (if applicable):

light:
  - platform: yeelight
    devices:
      192.168.1.25:
        name: Living Room
        transition: 1000
        use_music_mode: True #(defaults to False)
        save_on_change: False #(defaults to True)
        model: color1
      192.168.1.13:
        name: Front Door
        model: ceiling1

@@ -195,6 +206,15 @@ def __init__(self, device, config):
self._is_on = None
self._hs = None

self._model = config['model']
self._min_mireds = None
Copy link
Member

Choose a reason for hiding this comment

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

Maybe move the kelvin_to_mired(YEELIGHT_SPECS['color1']['max_kelvin']) defaults from def min_mireds here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could move it to the update call. The capabilities of the device are determined at runtime unfortunately.

@syssi syssi changed the title Provide a individual color temperature range per Yeelight model Provide an individual color temperature range per Yeelight model Apr 26, 2018
@tinloaf
Copy link
Contributor

tinloaf commented May 9, 2018

Thanks for tackling this! This has been annoying me for a while… However, I get the feeling that the model-to-temperature-range mapping is hardware-level information and should therefore probably go into the upstream yeelight package? Basically, wouldn't it be the cleanest solution if the yeelight package would offer a get_temperature_range method?

@rytilahti
Copy link
Member

rytilahti commented May 9, 2018

I agree that this should go into python-yeelight, even when it has currently no clear concept of "models". Maybe that's something to discuss with @skorokithakis, if he'd accept it as it is or if we should find a better solution. The problem I see on the end of python-yeelight is that the model information is only given over mdns/discovery & there is no way to query that from a connected bulb via the API.

@skorokithakis
Copy link

Yes, this seems reasonable. It would be good to have this in python-yeelight, would you care to make a PR there? I don't remember whether the bulbs themselves can return their range, but, since you've hardcoded a lookup table based on the model, I'm assuming they can't.

Either way, we may need to implement some capability-reporting functionality. We can discuss in an issue or PR.

@louis-lau
Copy link

Hey, just did a PR (home-assistant/home-assistant.io#5338) on the docs to add the model number of the gen 2 yeelight bulb. I then noticed your edit. Should I PR to your edited branch instead?

btw, mdns name of the bulb is yeelink-light-color2.

@syssi
Copy link
Member Author

syssi commented May 10, 2018

I will try to port the feature to python-yeelight.

@louis-lau I merged your PR and updated mine. ;-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Yeelight Wifi Lamp can't change Color Temperature
8 participants