Skip to content

Commit

Permalink
✨ Track camera stack and make visible in version
Browse files Browse the repository at this point in the history
The new camera-streamer based camera stack will
now get a "cam" suffix on the version in the footer.

The information which camera stack was found
is also now included in the system info bundle
for the bundleviewer to utilize.

As requested in OctoPrint/OctoPi-UpToDate#9
  • Loading branch information
foosel committed Oct 10, 2023
1 parent bd43acb commit d8ae51d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions octoprint_pi_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ def get_additional_environment(self):

if is_octopi():
result["octopi_version"] = get_octopi_version()
result["octopi_camera_stack"] = (
"camera-streamer" if is_new_camerastack() else "webcamd"
)

if is_octopiuptodate():
result["octopiuptodate_build"] = get_octopiuptodate_build()
Expand Down
3 changes: 3 additions & 0 deletions octoprint_pi_support/static/js/pi_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,15 @@ $(function () {
if (!response.octopi_version) return;

if (response.octopiuptodate_build_short) {
let cam_suffix =
response.octopi_camera_stack == "camera-streamer" ? "cam" : "";
var octoPiVersion = $(
"<li id='pi_support_footer'><small>" +
gettext("OctoPi") +
"* " +
"<span class='octopi_version'>" +
response.octopi_version +
cam_suffix +
" (build " +
response.octopiuptodate_build_short +
")" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<h4>The up-to-date version of OctoPi</h4>

<p>Build <span class="plugin_pi_support_octopiuptodate_build">{{ plugin_pi_support_octopiuptodate_build_short }}</span>, based on OctoPi {{ plugin_pi_support_octopi_version }}, running on <span class="plugin_pi_support_model">{{ plugin_pi_support_model }}</span></p>
<p>Build <span class="plugin_pi_support_octopiuptodate_build">{{ plugin_pi_support_octopiuptodate_build_short }}</span> with "{{ plugin_pi_support_octopi_camera_stack }}", based on OctoPi {{ plugin_pi_support_octopi_version }}, running on <span class="plugin_pi_support_model">{{ plugin_pi_support_model }}</span></p>

<ul class="fa-ul">
<li><i class="fa-li fas fa-home"></i> Website: <a href="https://octoprint.org/download/" target="_blank" rel="noreferrer noopener">octoprint.org/download</a></li>
Expand Down

0 comments on commit d8ae51d

Please sign in to comment.