Merge pull request #694 from bbernhard/octoprint_long_error

small improvements in octoprint plugin
This commit is contained in:
tobi-wan-kenobi 2020-08-30 09:21:04 +02:00 committed by GitHub
commit 9d5035fa10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,8 +85,15 @@ class Module(core.module.Module):
core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.__show_popup) core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.__show_popup)
def octoprint_status(self, widget): def octoprint_status(self, widget):
if self.__octoprint_state == "Offline" or self.__octoprint_state == "Unknown": if (
return self.__octoprint_state self.__octoprint_state.startswith("Offline")
or self.__octoprint_state == "Unknown"
):
return (
(self.__octoprint_state[:25] + "...")
if len(self.__octoprint_state) > 25
else self.__octoprint_state
)
return ( return (
self.__octoprint_state self.__octoprint_state
+ " | B: " + " | B: "