Prevent panic if mqtt not configured
This commit is contained in:
parent
2bfeed5451
commit
5a69cf7fd0
1 changed files with 3 additions and 0 deletions
|
|
@ -66,6 +66,9 @@ func NewBoolGetterFromConfig(pc *Config) (res BoolGetter) {
|
|||
func NewFloatGetterFromConfig(pc *Config) (res FloatGetter) {
|
||||
switch pc.Type {
|
||||
case "mqtt":
|
||||
if MQTT == nil {
|
||||
log.FATAL.Fatal("mqtt not configured")
|
||||
}
|
||||
if pc.Timeout == 0 {
|
||||
pc.Timeout = mqttTimeout
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue