rename default fan speed variable to be more clear

This commit is contained in:
ntoff 2017-09-06 17:52:23 +10:00
parent b03a045b24
commit 988512f522
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class FanSliderPlugin(octoprint.plugin.StartupPlugin,
def get_settings_defaults(self):
return dict(
fanSpeed=100,
defaultFanSpeed=100,
minSpeed=0,
maxSpeed=100
)
@ -36,7 +36,7 @@ class FanSliderPlugin(octoprint.plugin.StartupPlugin,
]
def get_settings_updates(self):
self.fanSpeed = self._settings.get(["fanSpeed"])
self.defaultFanSpeed = self._settings.get(["defaultFanSpeed"])
self.minSpeed = self._settings.get(["minSpeed"])
self.maxSpeed = self._settings.get(["maxSpeed"])

View File

@ -54,7 +54,7 @@ $(function() {
}
//retrieve settings
self.onBeforeBinding = function() {
fanSpeed(self.settings.settings.plugins.fanspeedslider.fanSpeed());
fanSpeed(self.settings.settings.plugins.fanspeedslider.defaultFanSpeed());
}
}
OCTOPRINT_VIEWMODELS.push([

View File

@ -6,7 +6,7 @@
<label class="control-label">{{ _('Default Value') }}</label>
<div class="controls">
<div class="input-append">
<input type="number" min="0" max="100" class="input-mini" data-bind="value: settings.plugins.fanspeedslider.fanSpeed">
<input type="number" min="0" max="100" class="input-mini" data-bind="value: settings.plugins.fanspeedslider.defaultFanSpeed">
<span class="add-on">%</span>
</div>
<span class="help-block">{{ _('The default value the slider will be set to when opening OctoPrint\'s UI') }}</span>