From b1e3d4a0b487188811abb1bb2649779af6998aa5 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:51:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/jackery/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/jackery/sensor.py b/custom_components/jackery/sensor.py index 8aa7948..48e2db6 100644 --- a/custom_components/jackery/sensor.py +++ b/custom_components/jackery/sensor.py @@ -588,8 +588,8 @@ class JackeryDataCoordinator: # 检查通讯状态 (如果 commState 存在且为 0 可能表示离线,视具体协议而定,这里暂定只要有数据即可) # TphasePw: 总正向有功 (Grid Buy) # TnphasePw: 总负向有功 (Grid Sell) - t_phase_pw = ct_data.get("TphasePw") - tn_phase_pw = ct_data.get("TnphasePw") + t_phase_pw = ct_data.get("TphasePw") or ct_data.get("tPhasePw") + tn_phase_pw = ct_data.get("TnphasePw") or ct_data.get("tnPhasePw") if t_phase_pw is not None and tn_phase_pw is not None: grid_buy = float(t_phase_pw)