File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,20 @@ def initialize(self):
19
19
GPIO .setmode (GPIO .BOARD ) # Use the board numbering scheme
20
20
GPIO .setwarnings (False ) # Disable GPIO warnings
21
21
22
+ @property
23
+ def pin (self ):
24
+ return int (self ._settings .get (["pin" ]))
25
+
26
+ @property
27
+ def bounce (self ):
28
+ return int (self ._settings .get (["bounce" ]))
29
+
30
+ @property
31
+ def switch (self ):
32
+ return int (self ._settings .get (["switch" ]))
33
+
22
34
def on_after_startup (self ):
23
35
self ._logger .info ("Filament Sensor Reloaded started" )
24
- self .pin = int (self ._settings .get (["pin" ]))
25
- self .bounce = int (self ._settings .get (["bounce" ]))
26
- self .switch = int (self ._settings .get (["switch" ]))
27
-
28
36
if self ._settings .get (["pin" ]) != "-1" : # If a pin is defined
29
37
self ._logger .info ("Filament Sensor active on GPIO Pin [%s]" % self .pin )
30
38
GPIO .setup (self .pin , GPIO .IN , pull_up_down = GPIO .PUD_UP ) # Initialize GPIO as INPUT
You can’t perform that action at this time.
0 commit comments