File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,24 @@ def get_template_configs(self):
48
48
return [dict (type = "settings" , custom_bindings = False )]
49
49
50
50
def on_event (self , event , payload ):
51
- if event == Events .PRINT_STARTED : # If a new print is beginning
52
- self ._logger .info ("Printing started: Filament sensor enabled" )
51
+ # Printing
52
+ if event in (
53
+ Events .PRINT_STARTED ,
54
+ Events .PRINT_RESUMED
55
+ ):
56
+ self ._logger .info ("Printing: Filament sensor enabled" )
53
57
if self .pin != - 1 :
54
58
GPIO .remove_event_detect (self .pin )
55
59
GPIO .add_event_detect (self .pin , GPIO .BOTH , callback = self .check_gpio , bouncetime = self .bounce )
56
- elif event in (Events .PRINT_DONE , Events .PRINT_FAILED , Events .PRINT_CANCELLED ):
57
- self ._logger .info ("Printing stopped: Filament sensor disabled" )
60
+ # Not printing
61
+ elif event in (
62
+ Events .PRINT_DONE ,
63
+ Events .PRINT_FAILED ,
64
+ Events .PRINT_CANCELLED ,
65
+ Events .PRINT_PAUSED ,
66
+ Events .ERROR
67
+ ):
68
+ self ._logger .info ("Not printing: Filament sensor disabled" )
58
69
try :
59
70
GPIO .remove_event_detect (self .pin )
60
71
except Exception :
You can’t perform that action at this time.
0 commit comments