hue hue hue

This commit is contained in:
2022-08-28 21:39:36 +02:00
parent d1f42d932b
commit e00fe2a4d2
16 changed files with 1300 additions and 77 deletions
+13 -7
View File
@@ -3,6 +3,7 @@ package events
import (
"fmt"
"git.aiterp.net/lucifer3/server/device"
"git.aiterp.net/lucifer3/server/internal/color"
)
type DeviceConnected struct {
@@ -23,13 +24,16 @@ func (e DeviceDisconnected) EventDescription() string {
}
type HardwareState struct {
ID string `json:"internalId"`
InternalName string `json:"internalName"`
SupportFlags device.SupportFlags `json:"deviceFlags"`
ColorFlags device.ColorFlag `json:"colorFlags"`
Buttons []string `json:"buttons"`
State device.State `json:"state"`
Unreachable bool `json:"unreachable"`
ID string `json:"internalId"`
InternalName string `json:"internalName"`
SupportFlags device.SupportFlags `json:"supportFlags"`
ColorFlags device.ColorFlags `json:"colorFlags"`
ColorGamut *color.Gamut `json:"colorGamut,omitempty"`
TemperatureRange *[2]int `json:"temperatureRange,omitempty"`
Buttons []string `json:"buttons"`
State device.State `json:"state"`
BatteryPercentage *int `json:"batteryPercentage"`
Unreachable bool `json:"unreachable"`
}
func (e HardwareState) EventDescription() string {
@@ -38,6 +42,8 @@ func (e HardwareState) EventDescription() string {
)
}
// HardwareMetadata contains things that has no bearing on the functionality of
// lucifer, but may be interesting to have in the GUI.
type HardwareMetadata struct {
ID string `json:"id"`
X int `json:"x,omitempty"`