From c59f1b1ca76cd5031eb866a91849f76c94ebaaf6 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Sun, 23 Feb 2025 07:23:01 +0100 Subject: [PATCH] Config: show messaging configured state (v2) (#19083) --- api/globalconfig/types.go | 4 ++++ cmd/root.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/globalconfig/types.go b/api/globalconfig/types.go index 7c1a80f5c..94db479ff 100644 --- a/api/globalconfig/types.go +++ b/api/globalconfig/types.go @@ -134,6 +134,10 @@ type Messaging struct { Services []config.Typed } +func (c Messaging) Configured() bool { + return len(c.Services) > 0 +} + type Tariffs struct { Currency string Grid config.Typed diff --git a/cmd/root.go b/cmd/root.go index a905d6aaa..83e27c6df 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -257,7 +257,7 @@ func runRoot(cmd *cobra.Command, args []string) { valueChan <- util.Param{Key: keys.Hems, Val: conf.HEMS} valueChan <- util.Param{Key: keys.Influx, Val: conf.Influx} valueChan <- util.Param{Key: keys.Interval, Val: conf.Interval} - valueChan <- util.Param{Key: keys.Messaging, Val: pushChan != nil} + valueChan <- util.Param{Key: keys.Messaging, Val: conf.Messaging.Configured()} valueChan <- util.Param{Key: keys.ModbusProxy, Val: conf.ModbusProxy} valueChan <- util.Param{Key: keys.Mqtt, Val: conf.Mqtt} valueChan <- util.Param{Key: keys.Network, Val: conf.Network}