From 4156a106854ddf4776cadc8b9ac663d6464ffb1d Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 9 Jan 2023 11:41:40 -0600 Subject: [PATCH] hass: Omit retain when it is None Home Assistant refuses to parse entity configuration objects if the value of the `retain` field is `null`. --- src/hass.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hass.rs b/src/hass.rs index 368d56c..1b56d70 100644 --- a/src/hass.rs +++ b/src/hass.rs @@ -34,6 +34,7 @@ pub struct HassConfig { pub unique_id: String, pub object_id: String, pub icon: String, + #[serde(skip_serializing_if = "Option::is_none")] pub retain: Option, }