From 7cdc180a6c56a22e507b71084ebf659d60649b6f Mon Sep 17 00:00:00 2001 From: Maxime Augier Date: Mon, 26 Aug 2024 14:35:31 +0200 Subject: [PATCH] Fix handling of booleans in SignalR --- src/observation.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/observation.rs b/src/observation.rs index ecb05b4..13ac64f 100644 --- a/src/observation.rs +++ b/src/observation.rs @@ -84,10 +84,14 @@ impl ObservationData { fn from_dynamic(value: String, data_type: DataType) -> Result { Ok(match data_type { DataType::Boolean => ObservationData::Boolean( - value + match &*value { + "False"|"false" => { false }, + "True"|"true" => { true } + other => other .parse::() .map_err(move |e| ParseError::Integer(value, e))? != 0, + } ), DataType::Double => ObservationData::Double( value