From 8015ed2be5039ea416645fe85211d986ff97ec22 Mon Sep 17 00:00:00 2001 From: Bennett Wetters Date: Tue, 13 Feb 2024 19:37:52 +0100 Subject: [PATCH] Location is optional for beverage_supply so make it omitempty --- config-template.json | 10 ++++++++++ types/v14.go | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config-template.json b/config-template.json index 48d4f84..31cb500 100644 --- a/config-template.json +++ b/config-template.json @@ -46,6 +46,16 @@ "club-assistant" ] } + ], + "beverage_supply": [ + { + "sensor_data": { + "unit": "btl" + }, + "allowed_credentials": [ + "club-assistant" + ] + } ] }, "state": { diff --git a/types/v14.go b/types/v14.go index 2bcdc06..2492639 100644 --- a/types/v14.go +++ b/types/v14.go @@ -45,7 +45,7 @@ type SpaceState struct { type EnvironmentSensor struct { Value float64 `json:"value"` Unit string `json:"unit"` - Location string `json:"location"` + Location string `json:"location,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` LastChange int64 `json:"lastchange,omitempty"` @@ -61,7 +61,7 @@ type PersistentStateV14 struct { type PersistentEnvironmentSensor struct { Value float64 `json:"value"` - Location string `json:"location"` + Location string `json:"location,omitempty"` Name string `json:"name,omitempty"` LastChange int64 `json:"lastchange"` }