This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user