Skip to content

Commit 7df8b46

Browse files
authored
Merge pull request #30 from Salamafet/dev
add auto connect time option
2 parents 9e23041 + 445ff17 commit 7df8b46

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

octoprint_phom/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def get_settings_defaults(self):
3535
auto_off_bed_temp = 60,
3636
auto_off_nozzle_temp = 50,
3737
auto_connect = False,
38+
auto_connect_time = 5,
3839
security_connection_lost = False,
3940
security_emergency_stop = True,
4041
security_nozzle_temp = 250,
@@ -62,7 +63,8 @@ def get_template_vars(self):
6263
auto_off=self._settings.get(["auto_off"]),
6364
auto_off_bed_temp=self._settings.get(["auto_off_bed_temp"]),
6465
auto_off_nozzle_temp=self._settings.get(["auto_off_nozzle_temp"]),
65-
auto_connect=self._settings.get(['auto_connect'])
66+
auto_connect=self._settings.get(['auto_connect']),
67+
auto_connect_time=self._settings.get(['auto_connect_time'])
6668
)
6769

6870
def get_template_configs(self):

octoprint_phom/templates/ophom_navbar.jinja2

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
body : JSON.stringify({command: "connect"}),
127127
headers: { 'Content-Type': 'application/json'}
128128
});
129-
}, 5000)
129+
}, Number(data.plugins.ophom.auto_connect_time) * 1000)
130130
}
131131
})
132132
})

octoprint_phom/templates/ophom_settings.jinja2

+13-1
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,21 @@ Hue Bridge Status: <span id="ophom_generalstatus" class="badge badge-danger" sty
7070

7171
<label class="checkbox" disabled>
7272
<input type="checkbox" value="" data-bind="checked: settings.plugins.ophom.auto_connect">
73-
Try to connect to printer after power On the plug ? (~5sec)
73+
Try to connect to printer after power On the plug ?
7474
</label>
7575

76+
<table>
77+
<tr>
78+
<td>Time to wait before auto connect: </td>
79+
<td>
80+
<div class="input-append">
81+
<input class="span3 controls" id="auto_connect_time" type="text" data-bind="value: settings.plugins.ophom.auto_connect_time">
82+
<span class="add-on">sec</span>
83+
</div>
84+
</td>
85+
</tr>
86+
</table>
87+
7688
<br />
7789

7890
<div class="well">

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "Ophom"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "1.3.2"
17+
plugin_version = "1.3.3"
1818

1919
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2020
# module

0 commit comments

Comments
 (0)