Skip to content

Commit 867f920

Browse files
committed
Add board mode selection
1 parent 20cf457 commit 867f920

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

octoprint_filamentreload/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ def bounce(self):
3131
def switch(self):
3232
return int(self._settings.get(["switch"]))
3333

34+
@property
35+
def mode(self):
36+
return int(self._settings.get(["mode"]))
37+
3438
@property
3539
def after_pause_gcode(self):
3640
return str(self._settings.get(["after_pause_gcode"])).splitlines()
@@ -52,6 +56,7 @@ def get_settings_defaults(self):
5256
pin = -1, # Default is no pin
5357
bounce = 250, # Debounce 250ms
5458
switch = 0, # Normally Open
59+
mode = 0 # Board Mode
5560
after_pause_gcode = '',
5661
after_resume_gcode = '',
5762
)

octoprint_filamentreload/templates/filamentreload_settings.jinja2

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ Define the pin used by your sensor and the debounce timing for false positive pr
2424
</select>
2525
</div>
2626
</div>
27+
<div class="control-group">
28+
<label class="control-label">{{ _('Board Pin Mode:') }}</label>
29+
<div class="controls" data-toggle="tooltip" title="{{ _('RPi pins numbered in Board mode or BCM mode?') }}">
30+
<select class="select-mini" data-bind="value: settings.plugins.filamentreload.mode">
31+
<option value=0>{{ _('Board Mode') }}</option>
32+
<option value=1>{{ _('BCM Mode') }}</option>
33+
</select>
34+
</div>
35+
</div>
2736
<div class="control-group">
2837
<label class="control-label">{{ _('After pause GCODE:') }}</label>
2938
<div class="controls">

0 commit comments

Comments
 (0)