Browse Source

any/all.scene=-1 now checks for no scene.

feature-colorvalue2
Gisle Aune 3 years ago
parent
commit
6443e0ecd3
  1. 1
      app/services/events.go
  2. 4
      models/eventhandler.go

1
app/services/events.go

@ -67,7 +67,6 @@ func handleEvent(event models.Event) (responses []models.Event) {
err := handleSpecial(event) err := handleSpecial(event)
if err != nil { if err != nil {
log.Printf("Special event handler error (%s): %v", event.Name, err) log.Printf("Special event handler error (%s): %v", event.Name, err)
return
} }
paramStrings := make([]string, 0, 8) paramStrings := make([]string, 0, 8)

4
models/eventhandler.go

@ -170,10 +170,6 @@ func (c *EventCondition) checkDevice(key string, device Device) (matches bool, s
return c.matches(strconv.FormatFloat(device.State.Temperature, 'f', -1, 64)), false return c.matches(strconv.FormatFloat(device.State.Temperature, 'f', -1, 64)), false
case "scene": case "scene":
if len(device.SceneAssignments) == 0 {
return false, false
}
sceneId := -1 sceneId := -1
for _, assignment := range device.SceneAssignments { for _, assignment := range device.SceneAssignments {
duration := time.Duration(assignment.DurationMS) * time.Millisecond duration := time.Duration(assignment.DurationMS) * time.Millisecond

Loading…
Cancel
Save