- logging.info("Executing send_get_base_report...")
- request = ocpp.v201.call.GetBaseReport(reportBase=ReportBaseType.ConfigurationInventory) # Use correct ReportBaseType
- try:
- response = await self.call(request)
- logging.info("Send GetBaseReport")
-
- if response.status == "Accepted": # Adjust depending on the structure of your response
- logging.info("Send GetBaseReport successful")
- else:
- logging.info("Send GetBaseReport failed")
- except Exception as e:
- logging.error(f"Send GetBaseReport failed: {str(e)}")
- logging.info("send_get_base_report done.")
-
-# Define argument parser
-parser = argparse.ArgumentParser(description='OCPP Charge Point Simulator')
-parser.add_argument('--request', type=str, help='OCPP 2 Command Name')
-parser.add_argument('--delay', type=int, help='Delay in seconds')
-parser.add_argument('--period', type=int, help='Period in seconds')
-
-args = parser.parse_args()
+ request = ocpp.v201.call.GetBaseReport(
+ request_id=1, report_base=ReportBaseType.full_inventory
+ )
+ response = await self.call(request)
+
+ if response.status == GenericDeviceModelStatusType.accepted:
+ logging.info("%s successful", Action.GetBaseReport)
+ else:
+ logging.info("%s failed", Action.GetBaseReport)
+
+ async def send_command(self, command_name: Action):
+ logging.debug("Sending OCPP command: %s", command_name)
+ match command_name:
+ case Action.ClearCache:
+ await self.send_clear_cache()
+ case Action.GetBaseReport:
+ await self.send_get_base_report()
+ case _:
+ logging.info(f"Not supported command {command_name}")
+