import logging
from datetime import datetime, timezone
from threading import Timer
import logging
from datetime import datetime, timezone
from threading import Timer
-from ocpp.v201 import call_result
-from ocpp.v201.enums import RegistrationStatusType, ClearCacheStatusType
+from ocpp.v201.enums import RegistrationStatusType, ClearCacheStatusType, Action
# Setting up the logging configuration to display debug level messages.
logging.basicConfig(level=logging.DEBUG)
# Setting up the logging configuration to display debug level messages.
logging.basicConfig(level=logging.DEBUG)
# Define a ChargePoint class inheriting from the OCPP 2.0.1 ChargePoint class.
class ChargePoint(ocpp.v201.ChargePoint):
# Message handlers to receive OCPP messages.
# Define a ChargePoint class inheriting from the OCPP 2.0.1 ChargePoint class.
class ChargePoint(ocpp.v201.ChargePoint):
# Message handlers to receive OCPP messages.
async def on_boot_notification(self, charging_station, reason, **kwargs):
logging.info("Received BootNotification")
# Create and return a BootNotification response with the current time,
# an interval of 10 seconds, and an accepted status.
async def on_boot_notification(self, charging_station, reason, **kwargs):
logging.info("Received BootNotification")
# Create and return a BootNotification response with the current time,
# an interval of 10 seconds, and an accepted status.
current_time=datetime.now(timezone.utc).isoformat(),
interval=10,
status=RegistrationStatusType.accepted
current_time=datetime.now(timezone.utc).isoformat(),
interval=10,
status=RegistrationStatusType.accepted