Skip to content

Add charge start option delayed#1988

Closed
reneboer wants to merge 7 commits intohacf-fr:mainfrom
reneboer:rb-add-charge-start-option-delayed
Closed

Add charge start option delayed#1988
reneboer wants to merge 7 commits intohacf-fr:mainfrom
reneboer:rb-add-charge-start-option-delayed

Conversation

@reneboer
Copy link
Copy Markdown
Contributor

@reneboer reneboer commented Mar 6, 2026

Add the option to specify the startDateTime for the charge/start endpoint to mimic setting the Delayed Charging Mode. The optional parameter can be used when setting the below endpoint definition in models.py

"actions/charge-start": _KCM_ENDPOINTS["actions/charge-start-option-delayed"],

This will also be the basis for a new API version for the HA Renault Integration to add the Start Charge action with the optional start parameter.

I opened issue #1987 for any additional discussion.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.28%. Comparing base (25908a3) to head (f68ee7d).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1988      +/-   ##
==========================================
+ Coverage   86.79%   87.28%   +0.48%     
==========================================
  Files          34       34              
  Lines        2143     2312     +169     
  Branches      243      276      +33     
==========================================
+ Hits         1860     2018     +158     
- Misses        200      206       +6     
- Partials       83       88       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Removed type check for `when` variable in delayed mode as variable is declared with expected type already.
Copy link
Copy Markdown
Collaborator

@epenet epenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delay in coming back to you

Please address the comments above

Comment on lines +157 to +159
"actions/charge-start-option-delayed": EndpointDefinition(
"/kcm/v1/vehicles/{vin}/charge/start", mode="kcm-option-delayed"
),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once #2011 is merged, please use key "actions/charge-start" and mode "kcm"

Suggested change
"actions/charge-start-option-delayed": EndpointDefinition(
"/kcm/v1/vehicles/{vin}/charge/start", mode="kcm-option-delayed"
),
"actions/charge-start": EndpointDefinition(
"/kcm/v1/vehicles/{vin}/charge/start", mode="kcm"
),

},
"XCB1VE": { # MEGANE E-TECH
"actions/charge-start": _DEFAULT_ENDPOINTS["actions/charge-start"],
"actions/charge-start": _KCM_ENDPOINTS["actions/charge-start-option-delayed"],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once #2011 is merged, please use key "actions/charge-start"

Suggested change
"actions/charge-start": _KCM_ENDPOINTS["actions/charge-start-option-delayed"],
"actions/charge-start": _KCM_ENDPOINTS["actions/charge-start"],

},
}
}
else:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once #2011 is merged, please avoid using "else" for multiple endpoints.
Instead please check the mode explicitly and duplicate the json creation to avoid future conflicts

Suggested change
elif endpoint_definition.mode == "kcm":

@epenet epenet marked this pull request as draft March 23, 2026 07:57
@epenet
Copy link
Copy Markdown
Collaborator

epenet commented Mar 23, 2026

Closed in favour of #2010

@epenet epenet closed this Mar 23, 2026
@reneboer reneboer deleted the rb-add-charge-start-option-delayed branch March 23, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants