stefanwichmann / kelvin

Kelvin - The hue bot
MIT License
351 stars 37 forks source link

Add a list of models which don't support XY color. #79

Closed ademuri closed 2 years ago

ademuri commented 4 years ago

This works around models which say they support XY color, but do it incorrectly.

I have two Gledopto white/color bulbs. When I try to use them with mainline kelvin, during daytime they get set to a dim, relatively saturated color. It appears that they don't support XY color mode correctly. This change adds a list of light model IDs to never use with XY color.

I'm not sure if this is the right approach - it might be possible to infer this from the light properties. However, I'm pretty sure this change won't break anything. Here's the info on the bulb I have:

{
    "state": {
        "on": true,
        "bri": 254,
        "hue": 34560,
        "sat": 17,
        "effect": "none",
        "xy": [
            0.322,
            0.338
        ],
        "ct": 166,
        "alert": "none",
        "colormode": "ct",
        "mode": "homeautomation",
        "reachable": true
    },
    "swupdate": {
        "state": "notupdatable",
        "lastinstall": null
    },
    "type": "Extended color light",
    "name": "Adam color",
    "modelid": "GL-B-008Z",
    "manufacturername": "GLEDOPTO",
    "productname": "Extended color light",
    "capabilities": {
        "certified": false,
        "control": {
            "colorgamuttype": "other",
            "ct": {
                "min": 0,
                "max": 65535
            }
        },
        "streaming": {
            "renderer": false,
            "proxy": false
        }
    },
    "config": {
        "archetype": "classicbulb",
        "function": "mixed",
        "direction": "omnidirectional"
    },
    "uniqueid": "00:12:4b:00:1a:06:98:03-0b",
    "swversion": "1.0.3"
}
stefanwichmann commented 2 years ago

I added support for reading the capabilities from the lights in the go.hue library yesterday. That should allow a much better detection of supported functionality even for 3rd party bulbs.