-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add services to Renault integration #18981
Conversation
It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the |
ce6884f
to
4cc78e0
Compare
- `schedules` can be in the form `{'id':1,...}` when updating a single schedules, or in the form `[{'id':1,...},{'id':2,...},...]` when updating multiple schedules within the same call | ||
- the `id` is compulsory on each `schedule` (should be 1 to 5 depending on the vehicle) | ||
- the `activated` flag is an optional boolean. If it is not provided, then the existing flag will be kept as is. | ||
- the `monday` to `sunday` elements are optional. If they are not provided, then the existing settings will be kept for each day. If they are provided as None, then the existing setting will be cleared. If a value is provided, it must conform to this format `{'startTime':'T12:00Z','duration':15}` where start time is in UTC format and the duration is in minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed now that we only validate the time string as string in the service schema. Could we use the time validator to help users use the correct time string?
Then we can format the final string from the returned datetime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CLI version of RenaultAPI has some validation/conversion built in: https://github.com/hacf-fr/renault-api/blob/7c2336c52ed0298a3ed2b8e7dbb77b839676dced/src/renault_api/cli/charge/schedule.py#L202
There is also a draft PR to add validation to the non-CLI version: hacf-fr/renault-api#157
There are some extra rules like the minutes of startTime needs to be in (00,15,30,45) and the total duration needs to be a multiple of 15 minutes (eg. 240 is valid but not 245)
There are also some overlap rules (Monday 23:45 for 120 minutes and Tuesday 00:15 for 30 minutes is invalid)
I'll have a go at a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure when I'll get a chance to work on the new PR (there is also a request from @frenck to implement re-auth).
Should this documentation PR be merged anyway in the meantime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! The docs are fine.
| Service data attribute | Required | Description | Example | | ||
| ---------------------- | -------- | ----------- | ------- | | ||
| `vehicle`| yes | device_id of the vehicle | | ||
| `schedules` | yes | Schedule details. Can be a single schedule or a list of schedules | `[{'id':1,'activated':true,'monday':{'startTime':'T12:00Z','duration':15}},<br>{'id':2,'activated':false,'monday':{'startTime':'T12:00Z','duration':240}}<br>]` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed in the preview that the br tag doesn't work.
https://deploy-preview-18981--home-assistant-docs.netlify.app/integrations/renault/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to generate a preview, but I've moved the example out of the grid to gain some space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preview is generated automatically by the CI build. It's linked below among the PR checks.
Thanks |
Proposed change
Add services to Renault integration, as a follow up to #14383
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.