From 046bf759b26612b642bb7e427bae6041ce61c905 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 20 Dec 2025 12:18:41 +0100 Subject: Refactor with OPENCCU constant This unifies the HOST and PORT constants used so far and removes the need for a fmt.Sprintf() call. --- main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 47b6eef..c324010 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,7 @@ import ( ) const ( - HOST = `127.0.0.1` - PORT = 8080 + OPENCCU = `http://127.0.0.1:8080` BROKER = `tcp://127.0.0.1:1883` CLIENT_ID = `sia-server` TOPIC_PREFIX = `sia-server` @@ -19,9 +18,7 @@ const ( ) func main() { - server := fmt.Sprintf("http://%s:%d", HOST, PORT) - - req := homematic.NewRequester(server) + req := homematic.NewRequester(OPENCCU) inventory, err := req.ListDevices() if err != nil { -- cgit v1.2.3-70-g09d2