This commit is contained in:
alfrix
2024-01-16 15:33:50 -03:00
parent e402eb41b4
commit ac1c97a2fa
2 changed files with 6 additions and 1 deletions

View File

@@ -100,6 +100,10 @@ def get_software_version():
return "?"
def parse_bool(value):
return value.lower() == "true"
def patch_threading_excepthook():
"""Installs our exception handler into the threading modules Thread object
Inspired by https://bugs.python.org/issue1230540

View File

@@ -4,6 +4,7 @@ import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel
from ks_includes.functions import parse_bool
class Panel(ScreenPanel):
@@ -40,7 +41,7 @@ class Panel(ScreenPanel):
self.devices[pin] = {}
section = self._printer.get_config_section(pin)
if section.get('pwm') or section.get('hardware_pwm'):
if parse_bool(section.get('pwm', 'false')) or parse_bool(section.get('hardware_pwm', 'false')):
scale = Gtk.Scale.new_with_range(Gtk.Orientation.HORIZONTAL, min=0, max=100, step=1)
scale.set_value(self.check_pin_value(pin))
scale.set_digits(0)