diff --git a/cmd/dht2mqtt/main.go b/cmd/dht2mqtt/main.go index 88fb4e1..b39efa3 100644 --- a/cmd/dht2mqtt/main.go +++ b/cmd/dht2mqtt/main.go @@ -17,7 +17,7 @@ func watchAndPublish(sensorName string, publisher mqtt.Publisher, ch <-chan sens var lastPayload sensor.Payload lastChange := time.Now() for sensorPayload := range ch { - if sensorPayload.EqualTo(lastPayload) || time.Since(lastChange) > 5*time.Minute { + if !sensorPayload.EqualTo(lastPayload) || time.Since(lastChange) > 5*time.Minute { lastPayload = sensorPayload err := publisher.Publish(sensorName, sensorPayload) if err != nil {