From d94ecfc3d13746ba1751a7664fddac9acb32eb41 Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Mon, 1 Sep 2025 13:16:13 +0200 Subject: [PATCH 1/2] fix unbound local error --- packages/modules/devices/sungrow/sungrow/device.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/modules/devices/sungrow/sungrow/device.py b/packages/modules/devices/sungrow/sungrow/device.py index b9becf32a5..1e94b02a24 100644 --- a/packages/modules/devices/sungrow/sungrow/device.py +++ b/packages/modules/devices/sungrow/sungrow/device.py @@ -29,6 +29,7 @@ def create_inverter_component(component_config: SungrowInverterSetup): return SungrowInverter(component_config, device_config=device_config, client=client) def update_components(components: Iterable[Union[SungrowBat, SungrowCounter, SungrowInverter]]): + pv_power = None nonlocal client with client: for component in components: From 7af90cd29313357278026e2a7f2ae936b72e889a Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Mon, 1 Sep 2025 14:35:49 +0200 Subject: [PATCH 2/2] improve pv power --- packages/modules/devices/sungrow/sungrow/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/modules/devices/sungrow/sungrow/device.py b/packages/modules/devices/sungrow/sungrow/device.py index 1e94b02a24..69e5ed1e3a 100644 --- a/packages/modules/devices/sungrow/sungrow/device.py +++ b/packages/modules/devices/sungrow/sungrow/device.py @@ -29,7 +29,7 @@ def create_inverter_component(component_config: SungrowInverterSetup): return SungrowInverter(component_config, device_config=device_config, client=client) def update_components(components: Iterable[Union[SungrowBat, SungrowCounter, SungrowInverter]]): - pv_power = None + pv_power = 0 nonlocal client with client: for component in components: