paneldue: use extended confighelper methods
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
9ebae5fd5a
commit
4572bd955e
|
@ -207,22 +207,20 @@ class PanelDue:
|
||||||
self.confirmed_macros = {
|
self.confirmed_macros = {
|
||||||
"RESTART": "RESTART",
|
"RESTART": "RESTART",
|
||||||
"FIRMWARE_RESTART": "FIRMWARE_RESTART"}
|
"FIRMWARE_RESTART": "FIRMWARE_RESTART"}
|
||||||
macros = config.get('macros', None)
|
macros = config.getlist('macros', None)
|
||||||
if macros is not None:
|
if macros is not None:
|
||||||
# The macro's configuration name is the key, whereas the full
|
# The macro's configuration name is the key, whereas the full
|
||||||
# command is the value
|
# command is the value
|
||||||
macro_list = [m for m in macros.split('\n') if m.strip()]
|
self.available_macros = {m.split()[0]: m for m in macros}
|
||||||
self.available_macros = {m.split()[0]: m for m in macro_list}
|
conf_macros = config.getlist('confirmed_macros', None)
|
||||||
conf_macros = config.get('confirmed_macros', None)
|
|
||||||
if conf_macros is not None:
|
if conf_macros is not None:
|
||||||
# The macro's configuration name is the key, whereas the full
|
# The macro's configuration name is the key, whereas the full
|
||||||
# command is the value
|
# command is the value
|
||||||
macro_list = [m for m in conf_macros.split('\n') if m.strip()]
|
self.confirmed_macros = {m.split()[0]: m for m in conf_macros}
|
||||||
self.confirmed_macros = {m.split()[0]: m for m in macro_list}
|
|
||||||
self.available_macros.update(self.confirmed_macros)
|
self.available_macros.update(self.confirmed_macros)
|
||||||
|
|
||||||
ntkeys = config.get('non_trivial_keys', "Klipper state")
|
self.non_trivial_keys = config.getlist('non_trivial_keys',
|
||||||
self.non_trivial_keys = [k for k in ntkeys.split('\n') if k.strip()]
|
["Klipper state"])
|
||||||
self.ser_conn = SerialConnection(config, self)
|
self.ser_conn = SerialConnection(config, self)
|
||||||
logging.info("PanelDue Configured")
|
logging.info("PanelDue Configured")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue