From bac4d084ee6e54d3605f8100be5a459ec82e9c24 Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 24 Aug 2026 16:44:33 +1200 Subject: [PATCH] Add a timeout override to get_charge_point_energy_meter_reading The default httpx timeout is too short for this command's round trip to the physical charger. On an ONLINE, idle E2 with a CT clamp installed, a call raised ReadTimeout (treated as offline) under the default timeout, then succeeded in ~15-20s once given timeout=30. Adds an optional timeout parameter, defaulting to 30s, matching the existing pattern in get_charge_point_override. No behavior change for callers that already pass a timeout or for fast responses; only widens the window before treating the charger as offline. Related to #109. --- evnex/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evnex/api.py b/evnex/api.py index 62dd630..e81a44a 100644 --- a/evnex/api.py +++ b/evnex/api.py @@ -352,7 +352,7 @@ async def get_charge_point_status( @api_retry(ReadTimeout) async def get_charge_point_energy_meter_reading( - self, charge_point_id: str + self, charge_point_id: str, timeout: float = 30 ) -> EvnexChargePointEnergyMeterReadingResponse: """ :param charge_point_id: @@ -361,6 +361,7 @@ async def get_charge_point_energy_meter_reading( r = await self._request( "POST", f"/charge-points/{charge_point_id}/commands/get-energy-meter-reading", + timeout=timeout, ) json_data = await self._check_api_response(r)