It adds another field snapshot_url to each webcam.
It makes the webcam settings available to other plugins via helper get_webcams.
The field snapshot_url isn't used by this plugin, but there are (at least one) other plugins using this value. But without it being available elsewhere, there are two possibilities:
Try to construct it yourself ("take the stream URL, attach ?action=snapshot and hope for the best")
Have the user configure the webcam URLs, leading to having two places in the settings to configure if you change your webcam setup.
Since pretty much every user using more than one webcam is going to use this plugin, I think it is the right place to have that setting as well.
Via the new helper get_webcams, other plugins can easily get that data without having to do other work such as falling back to reading the values from octoprint for the default webcam - the helper returns a "clean" array, with the data for the first webcam correctly filled out.
Thanks for the help, but it would seem there are conflicts with this and the base. If you don't mind resolving those I will gladly merge your changes into the base.
Hi.
This pull requests does two things:
snapshot_url
to each webcam.get_webcams
.The field
snapshot_url
isn't used by this plugin, but there are (at least one) other plugins using this value. But without it being available elsewhere, there are two possibilities:?action=snapshot
and hope for the best")Since pretty much every user using more than one webcam is going to use this plugin, I think it is the right place to have that setting as well.
Via the new helper
get_webcams
, other plugins can easily get that data without having to do other work such as falling back to reading the values from octoprint for the default webcam - the helper returns a "clean" array, with the data for the first webcam correctly filled out.