From 5251f963a6d44417473c906534be95436d9bb695 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 15 Jan 2017 01:22:35 +0300 Subject: [PATCH] Remove retain flag for event based sensors (only switch for now) --- src/mqtt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mqtt.py b/src/mqtt.py index 839c541..e5d2d53 100644 --- a/src/mqtt.py +++ b/src/mqtt.py @@ -72,6 +72,9 @@ class Mqtt: if (model == "motion" and key == "no_motion"): key="status" value="no_motion" + # do not retain event-based sensors (like switches). + if (model == "switch"): + retain = False # fix for rgb format if (key == "rgb" and self._is_int(value)):