Skip to content

Commit

Permalink
added get_status, fixed help strings
Browse files Browse the repository at this point in the history
  • Loading branch information
julianschill committed Nov 1, 2024
1 parent 56d1d48 commit eea98c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/led_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def __init__(self, config):
self.printer.register_event_handler('klippy:ready', self._handle_ready)
self.gcode.register_mux_command('SET_LED_EFFECT', 'EFFECT', self.name,
self.cmd_SET_LED_EFFECT,
desc=self.cmd_SET_LED_help)
desc=self.cmd_SET_LED_EFFECT_help)

if self.analogPin:
ppins = self.printer.lookup_object('pins')
Expand All @@ -372,7 +372,7 @@ def __init__(self, config):
buttons = self.printer.load_object(config, "buttons")
buttons.register_buttons(self.buttonPins, self.button_callback)

cmd_SET_LED_help = 'Starts or Stops the specified led_effect'
cmd_SET_LED_EFFECT_help = 'Starts or Stops the specified led_effect'

def _handle_ready(self):
self.configChains = self.configLeds.split('\n')
Expand Down Expand Up @@ -539,6 +539,9 @@ def cmd_SET_LED_EFFECT(self, gcmd):
if gcmd.get_int('RESTART', 0) >= 1:
self.reset_frame()
self.set_enabled(True)

def get_status(self, eventtime):
return {'enabled':self.enabled}

def _handle_shutdown(self):
self.set_enabled(self.runOnShutown)
Expand Down

0 comments on commit eea98c8

Please sign in to comment.