summaryrefslogtreecommitdiff
path: root/cache.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2026-03-26 20:57:22 +0100
committerxengineering <me@xengineering.eu>2026-03-26 20:57:22 +0100
commit443ba52ab3f49a28e8874ebcb5476e36c3defb4c (patch)
tree3ac9b723f89889d6904e23bf0d54541539c0d671 /cache.go
parenta965777d436f3bd68686e3b33066459c7ed5a01c (diff)
downloadsia-server-443ba52ab3f49a28e8874ebcb5476e36c3defb4c.tar
sia-server-443ba52ab3f49a28e8874ebcb5476e36c3defb4c.tar.zst
sia-server-443ba52ab3f49a28e8874ebcb5476e36c3defb4c.zip
Add `Retain` attribute to MQTTMessage
This allows the sending part of the code to decide about the retain flag. The MQTT go routine will set it accordingly.
Diffstat (limited to 'cache.go')
-rw-r--r--cache.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.go b/cache.go
index 4e0eddc..18ce0c9 100644
--- a/cache.go
+++ b/cache.go
@@ -43,6 +43,7 @@ func (c *Cache) Update(states States) {
c.Tx <- MQTTMessage{
Topic: topic,
Payload: payload,
+ Retain: true,
}
}
c.States[id] = state