Skip to content

Commit d8ae51d

Browse files
committed
✨ Track camera stack and make visible in version
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
1 parent bd43acb commit d8ae51d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

octoprint_pi_support/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ def get_additional_environment(self):
379379

380380
if is_octopi():
381381
result["octopi_version"] = get_octopi_version()
382+
result["octopi_camera_stack"] = (
383+
"camera-streamer" if is_new_camerastack() else "webcamd"
384+
)
382385

383386
if is_octopiuptodate():
384387
result["octopiuptodate_build"] = get_octopiuptodate_build()

octoprint_pi_support/static/js/pi_support.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,15 @@ $(function () {
172172
if (!response.octopi_version) return;
173173

174174
if (response.octopiuptodate_build_short) {
175+
let cam_suffix =
176+
response.octopi_camera_stack == "camera-streamer" ? "cam" : "";
175177
var octoPiVersion = $(
176178
"<li id='pi_support_footer'><small>" +
177179
gettext("OctoPi") +
178180
"* " +
179181
"<span class='octopi_version'>" +
180182
response.octopi_version +
183+
cam_suffix +
181184
" (build " +
182185
response.octopiuptodate_build_short +
183186
")" +

octoprint_pi_support/templates/pi_support_about_octopiuptodate.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
<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>
5+
<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>
66

77
<ul class="fa-ul">
88
<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>

0 commit comments

Comments
 (0)