From d03694684dceeb90cc648b3b24f3eba83269bd43 Mon Sep 17 00:00:00 2001 From: Yinyin Liu Date: Thu, 4 Dec 2025 13:30:06 +0100 Subject: [PATCH] fixed Control Permission issue in Growatt Configuration tab --- .../SodistoreHomeConfiguration.tsx | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx index 1ced16d72..8d5625237 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx @@ -94,7 +94,9 @@ function SodistoreHomeConfiguration(props: SodistoreHomeConfigurationProps) { timeChargeDischargePower: props.values.Config?.TimeChargeDischargePower ?? 0, // default 0 W timeChargeDischargeTime: props.values.Config?.TimeChargeDischargeTime ? dayjs(props.values.Config.TimeChargeDischargeTime).toDate() : dayjs().hour(8).minute(0).second(0).toDate(), // default 08:00 timeChargeDischargeDate: props.values.Config?.TimeChargeDischargeDate ? dayjs(props.values.Config.TimeChargeDischargeDate).toDate() : dayjs().add(1, 'day').toDate(), // default = tomorrow - controlPermission: props.values.Config.ControlPermission??false, + // controlPermission: props.values.Config.ControlPermission??false, + controlPermission: String(props.values.Config.ControlPermission).toLowerCase() === "true", + // ...(device === 4 // ? { // clusterNumber: props.values.Config.ClusterNumber??1, @@ -312,21 +314,18 @@ function SodistoreHomeConfiguration(props: SodistoreHomeConfigurationProps) { labelPlacement="start" control={ - handleChange({ - target: { - name: "controlPermission", - value: e.target.checked - } - }) + setFormValues((prev) => ({ + ...prev, + controlPermission: e.target.checked, + })) } + sx={{ transform: "scale(1.4)", marginLeft: "15px" }} /> } + label={