add resolve service prototype.
This commit is contained in:
+2
-2
@@ -58,11 +58,11 @@ func (f ColorFlag) IsWarmWhite() bool {
|
||||
}
|
||||
|
||||
func (f ColorFlag) IsColorOnly() bool {
|
||||
return f != 0 && f&CFlagKelvin == 0
|
||||
return f.IsColor() && !f.IsWarmWhite()
|
||||
}
|
||||
|
||||
func (f ColorFlag) IsWarmWhiteOnly() bool {
|
||||
return f == CFlagKelvin
|
||||
return f.IsWarmWhite() && !f.IsColor()
|
||||
}
|
||||
|
||||
func (f ColorFlag) HasAny(d ColorFlag) bool {
|
||||
|
||||
@@ -11,11 +11,6 @@ type State struct {
|
||||
Temperature *float64 `json:"temperature"`
|
||||
Intensity *float64 `json:"intensity"`
|
||||
Color *color.Color `json:"color"`
|
||||
|
||||
SensedTemperature *float64 `json:"sensedTemperature"`
|
||||
SensedLightLevel *float64 `json:"sensedLightLevel"`
|
||||
SensedPresence *PresenceState `json:"sensedPresence"`
|
||||
SensedButton *int `json:"sensedButton"`
|
||||
}
|
||||
|
||||
func (d State) String() string {
|
||||
@@ -33,19 +28,6 @@ func (d State) String() string {
|
||||
parts = append(parts, fmt.Sprintf("color:%s", d.Color.String()))
|
||||
}
|
||||
|
||||
if d.SensedTemperature != nil {
|
||||
parts = append(parts, fmt.Sprintf("sensedTemperature:%.2f", *d.SensedTemperature))
|
||||
}
|
||||
if d.SensedLightLevel != nil {
|
||||
parts = append(parts, fmt.Sprintf("sensedLightLevel:%.1f", *d.SensedLightLevel))
|
||||
}
|
||||
if d.SensedPresence != nil {
|
||||
parts = append(parts, fmt.Sprintf("sensedPresense:(%t,%.1f)", d.SensedPresence.Present, d.SensedPresence.AbsenceSeconds))
|
||||
}
|
||||
if d.SensedButton != nil {
|
||||
parts = append(parts, fmt.Sprintf("sensedButton:%d", *d.SensedButton))
|
||||
}
|
||||
|
||||
return fmt.Sprint("(", strings.Join(parts, ", "), ")")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user