diff options
| author | xengineering <me@xengineering.eu> | 2025-12-20 12:18:41 +0100 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2025-12-20 12:18:41 +0100 |
| commit | 046bf759b26612b642bb7e427bae6041ce61c905 (patch) | |
| tree | 3d66452127bac7538443b4cb05e084ff60042ee3 | |
| parent | 03ceb4e5babba95c9ec60da580fbeac465aa0938 (diff) | |
| download | sia-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.
| -rw-r--r-- | main.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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 { |
