Skip to content

Commit

Permalink
prevent on_time/ramp_time if inputs are hidden (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Dec 23, 2018
1 parent e4ef042 commit 3863363
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion nodes/ccu-value.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,15 @@
}
if (c.datapoints.includes('RAMP_TIME')) {
$('.RAMP_TIME').show();
} else {
$('#node-input-ramp').typedInput('type', 'undefined');
$('#node-input-ramp').val('');
}
if (c.datapoints.includes('ON_TIME')) {
$('.ON_TIME').show();
} else {
$('#node-input-on').typedInput('type', 'undefined');
$('#node-input-on').val('');
}
}
}
Expand Down Expand Up @@ -211,6 +217,12 @@
},

oneditsave() {
if ($('#ON_TIME').is(':hidden')) {
this.onType = 'undefined';
}
if ($('#RAMP_TIME').is(':hidden')) {
this.rampType = 'undefined';
}
if (this.onType === 'undefined') {
this.on = 0;
}
Expand Down Expand Up @@ -330,4 +342,4 @@

<script type="text/x-red" data-help-name="ccu-value" lang="en-US">
<p>Set and read channel datapoints.</p>
</script>
</script>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-ccu",
"version": "1.10.5",
"version": "1.10.6",
"description": "Node-RED Nodes for the Homematic CCU",
"repository": "https://github.com/hobbyquaker/node-red-contrib-ccu",
"keywords": [
Expand Down

0 comments on commit 3863363

Please sign in to comment.