diff --git a/custom_components/ocpp/api.py b/custom_components/ocpp/api.py index 23549b70..13a7f1c1 100644 --- a/custom_components/ocpp/api.py +++ b/custom_components/ocpp/api.py @@ -98,6 +98,7 @@ CLEAR_PROFILE_SERVICE_DATA_SCHEMA = vol.Schema( { vol.Optional("devid"): cv.string, + vol.Optional("conn_id"): vol.Coerce(int), } ) @@ -892,7 +893,8 @@ async def handle_trigger_custom_message(self, call, cp): @check_charger_available async def handle_clear_profile(self, call, cp): """Handle the clear profile service call.""" - await cp.clear_profile() + conn_id = call.data.get("conn_id") + await cp.clear_profile(conn_id=conn_id) @check_charger_available async def handle_update_firmware(self, call, cp): diff --git a/custom_components/ocpp/services.yaml b/custom_components/ocpp/services.yaml index 2e98b3e8..b0d0a0db 100644 --- a/custom_components/ocpp/services.yaml +++ b/custom_components/ocpp/services.yaml @@ -78,6 +78,12 @@ clear_profile: required: false advanced: true example: charger + conn_id: + name: Connector ID + description: OCPP connector to clear profiles from + required: false + advanced: true + example: 1 update_firmware: name: Update charger firmware