Skip to content

fix: Revert the create_and_start_charge_point helper function#766

Open
a-alak wants to merge 1 commit into
mobilityhouse:masterfrom
a-alak:fix/revert-create-start-cp
Open

fix: Revert the create_and_start_charge_point helper function#766
a-alak wants to merge 1 commit into
mobilityhouse:masterfrom
a-alak:fix/revert-create-start-cp

Conversation

@a-alak

@a-alak a-alak commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Changes included in this PR

Deleted the function. Updated central system examples to not use the function.

Current behavior

The create_and_start_charge_point helper function is broken. If you are implementing a CSMS that is only handling incoming messages and you use the websockets library, it might be usable. But if you need to send central system initiated messages, you will loose the ChargePoint instance and not be able to interact with it.
I do not think this function belong here. It will create unnecessary friction for new users, that will spend a lot of time figuring out how to use and realising it is unusable if they need to track the ChargePoint instances.

Problems:

  1. The function will only return the ChargePoint instance after connection termination
  2. Increase coupling to websockets library

See PR #752

New behavior

The helper function is deleted and users are expected to instantiate the ChargePoint object and run the listener loop (cp.start()).

Impact

Breaking change: create_and_start_charge_point() is no longer available, use these 5 lines instead:

charge_point_id = extract_charge_point_id(websocket.request.path)
if not charge_point_id:
    return await websocket.close()

cp = ChargePoint(charge_point_id, websocket)
await cp.start()

Or something more suitable for your needs.

Checklist

  1. Does your submission pass the existing tests?
  2. Are there new tests that cover these additions/changes?
  3. Have you linted your code locally before submission?

Deleted the function. Updated central system examples to not use the
function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant