hass-emulated-hue / core

Hue Emulation for Home Assistant
Apache License 2.0
317 stars 55 forks source link

Config appears doubled in API (v1) output for lights #399

Open cdjm opened 1 year ago

cdjm commented 1 year ago

Description

Hello Devs,

When querying the light status by API call the config section of the light appears double nested. This is different from the output of the official Hue Bridge:

{ "state": { "on": true, "reachable": true, "mode": "homeautomation", "bri": 51, "alert": "none", "ct": 443, "effect": "none", "xy": [0.574, 0.388], "hue": 5279, "sat": 208, "colormode": "ct" }, "name": "Kueche Streifen links", "uniqueid": "8bafe180-1958-48fd-9137-528ed98c28e9", "swupdate": { "state": "noupdates", "lastinstall": "2023-02-08T22:27:50" }, "config": { "config": { "archetype": "sultanbulb", "direction": "omnidirectional", "function": "mixed", "startup": { "configured": true, "mode": "safety" } } }, "capabilities": { "certified": true, "control": { "mindimlevel": 200, "maxlumen": 800, "colorgamut": [[0.6915, 0.3083], [0.17, 0.7], [0.1532, 0.0475]], "colorgamuttype": "C" }, "streaming": { "proxy": true, "renderer": true } }, "type": "Extended color light", "manufacturername": "Signify Netherlands B.V.", "modelid": "Hue lightstrip plus (LST002)", "productname": "Kueche Streifen links", "swversion": "67.101.2" }

with the wrong section being: "config": { "config": { "archetype": "sultanbulb", "direction": "omnidirectional", "function": "mixed", "startup": { "configured": true, "mode": "safety" } } },

Expected behavior

Output should be similar to that of from the Hue Bridge:

{ "state": { "on": true, "bri": 51, "hue": 7676, "sat": 199, "effect": "none", "xy": [0.5016, 0.4151], "ct": 443, "alert": "select", "colormode": "xy", "mode": "homeautomation", "reachable": true }, "swupdate": { "state": "noupdates", "lastinstall": "2022-12-08T14:00:40" }, "type": "Extended color light", "name": "Kueche Streifen links", "modelid": "LST002", "manufacturername": "Signify Netherlands B.V.", "productname": "Hue lightstrip plus", "capabilities": { "certified": true, "control": { "mindimlevel": 25, "maxlumen": 1600, "colorgamuttype": "C", "colorgamut": [[0.6915, 0.3083], [0.1700, 0.7000], [0.1532, 0.0475]], "ct": { "min": 153, "max": 500 } }, "streaming": { "renderer": true, "proxy": true } }, "config": { "archetype": "huelightstrip", "function": "mixed", "direction": "omnidirectional", "startup": { "mode": "powerfail", "configured": true } }, "uniqueid": "00:17:88:01:01:1c:27:ec-0b", "swversion": "67.101.2" }

Reproduction steps

Query API using i.e.

http://a.b.c.d/api/apiuser/lights/13

Relevant log output

"config": {
        "config": {
            "archetype": "sultanbulb",
            "direction": "omnidirectional",
            "function": "mixed",
            "startup": {
                "configured": true,
                "mode": "safety"
            }
        }
    },

Operating system

HassOS

Install method

HassOS Addon

Version

dev/0.3.0

Dev Version

master@1b50572

Any other information that may be helpful

This bug is not causing any specific issue in my home automation setup but I guess this should be as close as possible to the original API output for a translation layer.

github-actions[bot] commented 1 year ago

This issue has been marked as stale due to no activity and will be closed in 7 days.