File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 6363_FLAG_PAST_FREQ_CAPPED = 1 << 17
6464_FLAG_PAST_THROTTLED = 1 << 18
6565
66+ _UNRECOMMENDED_MODELS = ("Zero" , "Zero W" )
67+
6668
6769class ThrottleState (object ):
6870 @classmethod
@@ -197,6 +199,14 @@ def is_octopi():
197199 return os .path .exists (_OCTOPI_VERSION_PATH )
198200
199201
202+ def is_model_any_of (model , * args ):
203+ model = model .lower ()
204+ for arg in map (lambda x : x .lower (), args ):
205+ if "{} rev" .format (arg ) in model or model .endswith (arg ):
206+ return True
207+ return False
208+
209+
200210_octopi_version = None
201211
202212
@@ -277,7 +287,9 @@ def on_api_get(self, request):
277287 result .update (
278288 {
279289 "throttle_state" : self ._throttle_state .as_dict (),
280- "model_unrecommended" : "zero" in result .get ("model" ).lower (),
290+ "model_unrecommended" : is_model_any_of (
291+ result .get ("model" ), * _UNRECOMMENDED_MODELS
292+ ),
281293 }
282294 )
283295 return flask .jsonify (** result )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ $(function () {
3535 ) {
3636 var warning = gettext (
3737 "OctoPrint does not and never has supported the " +
38- "RPi Zero or Zero W. Use at least a Raspberry Pi 3, or " +
38+ "RPi Zero or Zero W. Use at least a Raspberry Pi 3 or Zero 2 , or " +
3939 "risk bad performance and failed prints."
4040 ) ;
4141 var faq = gettext (
You can’t perform that action at this time.
0 commit comments