From 4a0925f5cda97708f358ccacb911d9cf130ce74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Mon, 2 Feb 2026 15:24:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0CT=20=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/jackery/sensor.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/custom_components/jackery/sensor.py b/custom_components/jackery/sensor.py index a9126ff..99b7d85 100644 --- a/custom_components/jackery/sensor.py +++ b/custom_components/jackery/sensor.py @@ -884,8 +884,31 @@ class JackeryPlugSensor(SensorEntity): @property def extra_state_attributes(self) -> dict[str, Any]: + raw = getattr(self, "_raw_data", None) or {} return { "plug_sn": self._plug_sn, "dev_type": self._dev_type, - "raw_data": getattr(self, "_raw_data", None) + "raw_data": raw, + # Normalized CT/plug fields (if present) + "sn": raw.get("sn") or raw.get("deviceSn"), + "name": raw.get("name") or raw.get("scanName"), + "commState": raw.get("commState"), + "funForm": raw.get("funForm"), + "schePhase": raw.get("schePhase"), + "AphasePw": raw.get("AphasePw") or raw.get("aPhasePw"), + "BphasePw": raw.get("BphasePw") or raw.get("bPhasePw"), + "CphasePw": raw.get("CphasePw") or raw.get("cPhasePw"), + "TphasePw": raw.get("TphasePw") or raw.get("tPhasePw"), + "AnphasePw": raw.get("AnphasePw") or raw.get("anPhasePw"), + "BnphasePw": raw.get("BnphasePw") or raw.get("bnPhasePw"), + "CnphasePw": raw.get("CnphasePw") or raw.get("cnPhasePw"), + "TnphasePw": raw.get("TnphasePw") or raw.get("tnPhasePw"), + "AphaseEgy": raw.get("AphaseEgy"), + "BphaseEgy": raw.get("BphaseEgy"), + "CphaseEgy": raw.get("CphaseEgy"), + "TphaseEgy": raw.get("TphaseEgy"), + "AnphaseEgy": raw.get("AnphaseEgy"), + "BnphaseEgy": raw.get("BnphaseEgy"), + "CnphaseEgy": raw.get("CnphaseEgy"), + "TnphaseEgy": raw.get("TnphaseEgy"), }