nielsfaber / scheduler-component

Custom component for HA that enables the creation of scheduler entities
GNU General Public License v3.0
622 stars 40 forks source link

Update websockets.py #287

Closed MaxDomo closed 11 months ago

MaxDomo commented 11 months ago

Adding new API route for get schedule list

nielsfaber commented 11 months ago

Thanks for your contribution. Before merging, could you elaborate a bit about this PR?

The scheduler-card also uses the websocket API to retrieve the list of schedules, so I wonder why the new functionality is needed. This section of code is used for retrieving the full list https://github.com/nielsfaber/scheduler-component/blob/5c42b50af2555197f48057951dd84fa52bef6577/custom_components/scheduler/websockets.py#L222-L230 Which should be accessible via the root URL 'scheduler' (without suffix /add or /edit etc.)

I am guessing you want to make a websocket connection to the component outside of the HA frontend?

MaxDomo commented 11 months ago

Hi ! I'm creating this pull request to list schedules directly from the Home Assistant REST API, rather than using the WebSocket API. This provides more possibilities and flexibility.

Thx

nielsfaber commented 11 months ago

OK clear, I will include your change in the next release 👍