diff --git a/meter/tasmota/types.go b/meter/tasmota/types.go index 14b2952c0..14abd30f5 100644 --- a/meter/tasmota/types.go +++ b/meter/tasmota/types.go @@ -96,6 +96,9 @@ type StatusSNSResponse struct { type Channels []float64 func (ch *Channels) Channel(channel int) (float64, error) { + if *ch == nil { + return 0, nil + } if channel < 1 || channel > len(*ch) { return 0, fmt.Errorf("invalid channel: %d", channel) }