diff options
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -9,17 +9,20 @@ import ( //go:embed configs/default.json var defaultConfig []byte -type StartupConfig struct { - MQTT struct { - Broker string `json:"broker"` - ClientID string `json:"client-id"` - TopicPrefix string `json:"topic-prefix"` - } `json:"mqtt"` +type MQTTConfig struct { + Broker string `json:"broker"` + ClientID string `json:"client-id"` + TopicPrefix string `json:"topic-prefix"` +} - Homematic struct { - CCU string `json:"ccu"` - PollingPeriodMilliseconds int `json:"polling-period-milliseconds"` - } `json:"homematic"` +type HomematicConfig struct { + CCU string `json:"ccu"` + PollingPeriod string `json:"polling-period"` +} + +type StartupConfig struct { + MQTT MQTTConfig `json:"mqtt"` + Homematic HomematicConfig `json:"homematic"` } func (sc *StartupConfig) FromJSON(data []byte) error { |
