From 526ade1d0117727c72f276e1fde4f164f418bc0a Mon Sep 17 00:00:00 2001 From: unocelli Date: Sat, 25 Nov 2023 21:35:24 +0100 Subject: [PATCH] fixed set boolean value of switch control #976 --- .../controls/html-switch/html-switch.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/app/gauges/controls/html-switch/html-switch.component.ts b/client/src/app/gauges/controls/html-switch/html-switch.component.ts index 37bb718b4..7c78b0355 100644 --- a/client/src/app/gauges/controls/html-switch/html-switch.component.ts +++ b/client/src/app/gauges/controls/html-switch/html-switch.component.ts @@ -64,10 +64,12 @@ export class HtmlSwitchComponent { } else { value = parseFloat(value.toFixed(5)); } - value = GaugeBaseComponent.checkBitmaskAndValue((ga.property).bitmask, - value, - (ga.property).options.offValue, - (ga.property).options.onValue); + if (typeof sig.value !== 'boolean') { + value = GaugeBaseComponent.checkBitmaskAndValue((ga.property).bitmask, + value, + (ga.property).options.offValue, + (ga.property).options.onValue); + } switcher.setValue(value); } } catch (err) {