From 5396eae035dfe02bc25d756972eeab81104c674c Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 20 Dec 2025 12:27:47 +0100 Subject: Change topic structure The new structure for the contact states is the following. /contact//state The reasoning is: - `` allows using multiple (Sia) services on the same broker - `contact` as device type indicates contact-specific semantics - `` makes different contacts distinguishable - `state` is the actual payload --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index eadcabb..075feb8 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ func main() { log.Fatalf("Failed to get value: %v", err) } - topic := fmt.Sprintf("%s/%s", TOPIC_PREFIX, device.Address) + topic := fmt.Sprintf("%s/contact/%s/state", TOPIC_PREFIX, device.Address) payload := []byte(fmt.Sprintf("%t", state)) client.Publish(topic, QOS, RETAINED, payload) } -- cgit v1.2.3-70-g09d2