Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blind correction #547

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion nodes/80-blind-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
* blind-control:
*********************************************/
'use strict';

const { debug } = require('console');

/** --- Type Defs ---
* @typedef {import('./types/typedefs.js').runtimeRED} runtimeRED
* @typedef {import('./types/typedefs.js').runtimeNode} runtimeNode
Expand Down Expand Up @@ -576,7 +579,7 @@ module.exports = function (/** @type {runtimeRED} */ RED) {
// node.debug(`set next time - smoothTime= ${node.smoothTime} changeAgain= ${node.sunData.changeAgain} nowNr=` + oNow.nowNr);
}
const levelMin = getBlindPosFromTI(node, msg, node.nodeData.levelMin.type, node.nodeData.levelMin.value, node.nodeData.levelBottom);
const levelMax = getBlindPosFromTI(node, msg, node.nodeData.levelMin.type, node.nodeData.levelMin.value, node.nodeData.levelBottom);
const levelMax = getBlindPosFromTI(node, msg, node.nodeData.levelMax.type, node.nodeData.levelMax.value, node.nodeData.levelTop);
if (node.level.current < levelMin) {
// min
node.debug(`${node.level.current} is below ${levelMin} (min)`);
Expand Down Expand Up @@ -1231,6 +1234,12 @@ module.exports = function (/** @type {runtimeRED} */ RED) {
}
break;
}
case 'setSunDataMinAltitude': {
node.sunData.sunMinAltitude = parseFloat(msg.payload) || node.sunData.sunMinAltitude; //TFR TODO see if it works
node.warn(`SunDataMinAltitude set to ${ node.sunData.sunMinAltitude}`);

}
break;
/* minimum changes Settings */
case 'setSunDataMinDelta':
node.sunData.minDelta = parseFloat(msg.payload) || node.sunData.minDelta; // payload of 0 makes no sense, use then default
Expand Down
28 changes: 14 additions & 14 deletions nodes/icons/inputTypeMoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.