summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2025-12-20 12:18:41 +0100
committerxengineering <me@xengineering.eu>2025-12-20 12:18:41 +0100
commit046bf759b26612b642bb7e427bae6041ce61c905 (patch)
tree3d66452127bac7538443b4cb05e084ff60042ee3 /main.go
parent03ceb4e5babba95c9ec60da580fbeac465aa0938 (diff)
downloadsia-server-046bf759b26612b642bb7e427bae6041ce61c905.tar
sia-server-046bf759b26612b642bb7e427bae6041ce61c905.tar.zst
sia-server-046bf759b26612b642bb7e427bae6041ce61c905.zip
Refactor with OPENCCU constant
This unifies the HOST and PORT constants used so far and removes the need for a fmt.Sprintf() call.
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files 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 {