Merge branch 'asmodeus' into feature-scenesystem
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-10-03 18:42:33 +02:00
18 changed files with 514 additions and 77 deletions
+7
View File
@@ -94,6 +94,9 @@ func handleEvent(event models.Event) (responses []models.Event) {
if handler.EventName != event.Name {
continue
}
if !handler.IsWithinTimeRange() {
continue
}
devices, err := config.DeviceRepository().FetchByReference(ctx, handler.TargetKind, handler.TargetValue)
if err != nil {
@@ -145,6 +148,10 @@ func handleEvent(event models.Event) (responses []models.Event) {
newState.Intensity = &newIntensity
}
if action.SetTemperature != nil {
newState.Temperature = action.SetTemperature
}
err = allDevices[i].SetState(newState)
if err != nil {
log.Println("Error updating state for device", device.ID, "err:", err)