Compare commits

..

2 commits

Author SHA1 Message Date
Oliver Traber dfa36b6294 Fix logging
All checks were successful
ci/woodpecker/push/docker Pipeline was successful
2024-04-20 17:36:35 +02:00
Oliver Traber 791d0834b9 Add MeterValues handler 2024-04-20 17:35:52 +02:00
2 changed files with 6 additions and 2 deletions

View file

@ -145,6 +145,10 @@ class ChargePoint(cp):
id_token_info = await self.__get_id_token_info(id_token)
return call_result.AuthorizePayload(id_token_info)
@on(Action.MeterValues)
async def on_meter_values(self, **kwargs):
return call_result.MeterValuesPayload()
@on(Action.TransactionEvent)
async def on_transaction_event(
self,

View file

@ -12,13 +12,13 @@ class WebSocketWrapper():
async def recv(self) -> str:
try:
text = await self._websocket.receive_text()
logger.info("Message received: {}", text)
logger.info("Message received: %s", text)
return text
except WebSocketDisconnect as e:
raise ConnectionClosed(e.code, 'WebSocketWrapper')
async def send(self, msg: str) -> None:
logger.info("Message sent: {}", msg)
logger.info("Message sent: %s", msg)
await self._websocket.send_text(msg)
async def close(self, code: int, reason: str) -> None: