add light level for api 1.28 support

This commit is contained in:
Wlad Meixner 2019-02-18 23:10:26 +01:00
parent 521d044b57
commit a5fe5e1feb

View File

@ -51,18 +51,18 @@ const (
// Group hue type
type Group struct {
Name string `json:"name"`
LightIDs []string `json:"lights"`
SensorIDs []string `json:"sensors"`
Type string `json:"type"`
State *GroupState `json:"state"`
Recycle bool `json:"recycle"`
ModelID string `json:"modelid,omitempty"`
UniqueID string `json:"uniqueid,omitempty"`
Class string `json:"class,omitempty"`
Action LightState `json:"action"`
Presence *GroupPresence `json:"presence,omitempty"`
// Lightlevel..
Name string `json:"name"`
LightIDs []string `json:"lights"`
SensorIDs []string `json:"sensors"`
Type string `json:"type"`
State *GroupState `json:"state"`
Recycle bool `json:"recycle"`
ModelID string `json:"modelid,omitempty"`
UniqueID string `json:"uniqueid,omitempty"`
Class string `json:"class,omitempty"`
Action LightState `json:"action"`
Presence *GroupPresence `json:"presence,omitempty"`
LightLevel *GroupLightLevel `json:"lightlevel,omitempty"`
}
// GroupPresence only exists if sensors array contains a presence sensor of type “ZLLPresence”, “CLIPPresence” or “Geofence”. This object contains a state object which contains the aggregated state of the sensors
@ -73,6 +73,19 @@ type GroupPresence struct {
PresenceAll bool `json:"presence_all"`
}
// GroupLightLevel light level struct
type GroupLightLevel struct {
// State?
LastUpdated Time `json:"lastupdated"`
Dark bool `json:"dark"`
DarkAll bool `json:"dark_all"`
Daylight bool `json:"daylight"`
DaylightAny bool `json:"daylight_any"`
Level int `json:"lightlevel"`
LevelMin int `json:"lightlevel_min"`
LevelMax int `json:"lightlevel_max"`
}
// GroupCreateResponse is returned after a create group request
type GroupCreateResponse struct {
Success struct {