From 8ab1c34b7f0d47a2f96dd1427bcdbdca64442543 Mon Sep 17 00:00:00 2001 From: wlcrs Date: Sun, 21 Jul 2024 14:41:52 +0000 Subject: [PATCH] Add debugging tfor #766 --- services.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/services.py b/services.py index c2af0d8..9cb86e0 100644 --- a/services.py +++ b/services.py @@ -227,7 +227,15 @@ def get_battery_bridge( ) -> tuple[HuaweiSolarBridge, HuaweiSolarUpdateCoordinator]: """Return the HuaweiSolarBridge associated with the battery device_id in the service call.""" device_id = service_call.data[DATA_DEVICE_ID] - return _get_battery_bridge(hass, device_id) + bridge, uc = _get_battery_bridge(hass, device_id) + + _LOGGER.info( + "Got the following bridge and update_coordinators in get_battery_bridge: %r, %r", + bridge, + uc, + ) + + return bridge, uc @callback @@ -567,6 +575,12 @@ def _parse_periods(text) -> list[PeakSettingPeriod]: bridge, uc = get_battery_bridge(hass, service_call) + _LOGGER.info( + "Got the following bridge and update_coordinators in set_capacity_control_periods: %r, %r", + bridge, + uc, + ) + if not re.fullmatch( CAPACITY_CONTROL_PERIODS_PATTERN, service_call.data[DATA_PERIODS] ):