Skip to content

Commit

Permalink
Add debugging tfor #766
Browse files Browse the repository at this point in the history
  • Loading branch information
wlcrs committed Jul 21, 2024
1 parent f0dfa27 commit 8ab1c34
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
):
Expand Down

0 comments on commit 8ab1c34

Please sign in to comment.