Skip to content

Implement create_charge_schedule function#1981

Open
reneboer wants to merge 7 commits intohacf-fr:mainfrom
reneboer:rb-implement-create_charge_schedule
Open

Implement create_charge_schedule function#1981
reneboer wants to merge 7 commits intohacf-fr:mainfrom
reneboer:rb-implement-create_charge_schedule

Conversation

@reneboer
Copy link
Contributor

Implemented the create_charge_schedule function to generate a charge schedule based on input settings, including day schedules as indicated in issue #1980

Implemented the create_charge_schedule function to generate a charge schedule based on input settings, including day schedules.
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.93%. Comparing base (6bf3692) to head (99eb378).

Files with missing lines Patch % Lines
src/renault_api/kamereon/helpers.py 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1981      +/-   ##
==========================================
+ Coverage   86.79%   86.93%   +0.13%     
==========================================
  Files          34       34              
  Lines        2143     2150       +7     
  Branches      243      245       +2     
==========================================
+ Hits         1860     1869       +9     
+ Misses        200      198       -2     
  Partials       83       83              

☔ 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.

@epenet
Copy link
Collaborator

epenet commented Mar 5, 2026

Please add some tests for the helper, probably with parametrized input + snapshot comparison

reneboer added 5 commits March 5, 2026 16:06
Add to test_renault_vehicle to simulate the set_charge_schedules when there is no current schedule and to simulate updating an existing schedule. This will trigger more helper functions to be used in tests and increase test coverage.
@reneboer
Copy link
Contributor Author

reneboer commented Mar 5, 2026

Please add some tests for the helper, probably with parametrized input + snapshot comparison

I was just working on that and uploaded an hour ago :-)

@reneboer
Copy link
Contributor Author

reneboer commented Mar 9, 2026

Hi epinet,

As FYI this is sort of the plan I have for all these updates. The two current PRs are to fix the issue that charge_set_schedule fails when the charging-settings endpoint returns an empty value for schedules. This happens when the charging mode is always or delayed. Then there is the basis for the charge_start action.

Then I also plan a PR to add more attributed to the KamereonVehicleChargingSettingsData class. Then a PR to update the models.py definition for the Megane. I found that the KCA endpoints for charging-start and charge-schedule do not really work anymore. The KCM endoint do work reliably, so I will update to those.

After that a PR to bump the version. After that I will do the Renault Integration. First the PR for version dependency and then the PR to add the start-charge action with an optional start date/time for the delayed charging. Lastly a PR for adding the additional attributes to the Charging Mode sensor.

Please let me know if you are ok with this plan.
Cheers Rene

@reneboer
Copy link
Contributor Author

Hi epinet,
As the more sunny time of the year is starting i wanted to get my automations working again to charge my car if the solar production is high. So i did end up making a custom component version of the HA Renault integration and included all changes I had planned and the extra attributes for the charging settings. If you want to have a look and see if you want some things done differently for your actual version then let me know: https://github.com/reneboer/renault_megane.

I hope we can get all the PRs done soon so I can use your integration again.
Cheers Rene

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