Initial commit
This commit is contained in:
11
time-based/old/early-night.js
Normal file
11
time-based/old/early-night.js
Normal file
@ -0,0 +1,11 @@
|
||||
var daynight = msg.payload
|
||||
|
||||
if (daynight === 0) {
|
||||
node.status({fill:"red",shape:"ring",text:"Off"});
|
||||
msg.payload = "off"
|
||||
} else if (daynight === 1) {
|
||||
node.status({fill:"green",shape:"dot",text:"On"});
|
||||
msg.payload = "on"
|
||||
}
|
||||
|
||||
return msg;
|
20
time-based/old/holiday-day.js
Normal file
20
time-based/old/holiday-day.js
Normal file
@ -0,0 +1,20 @@
|
||||
var states = global.get('homeassistant.homeAssistant.states')
|
||||
var holidayMode = states['input_boolean.holiday_mode'].state
|
||||
var holidayHold = states['input_boolean.holiday_mode_hold'].state
|
||||
var currentHoliday = states['input_select.holiday_animation'].state
|
||||
var holiday = currentHoliday.toLowerCase()
|
||||
|
||||
if (holidayMode === 'on') {
|
||||
if (holidayHold === 'off') {
|
||||
node.status({fill:"green",shape:"dot",text:"Holiday On" });
|
||||
msg.holiday = holiday
|
||||
return msg;
|
||||
} else {
|
||||
node.status({fill:"yellow",shape:"dot",text:"Holiday Hold On"});
|
||||
msg.holiday = holiday
|
||||
return msg;
|
||||
}
|
||||
} else {
|
||||
node.status({fill:"red",shape:"ring",text:"Holiday Off"});
|
||||
return null;
|
||||
}
|
13
time-based/old/holiday-night.js
Normal file
13
time-based/old/holiday-night.js
Normal file
@ -0,0 +1,13 @@
|
||||
var states = global.get('homeassistant.homeAssistant.states')
|
||||
var holidayMode = states['input_boolean.holiday_mode'].state
|
||||
var currentHoliday = states['input_select.holiday_animation'].state
|
||||
var holiday = currentHoliday.toLowerCase()
|
||||
|
||||
if (holidayMode === 'on') {
|
||||
msg.holiday = holiday
|
||||
node.status({fill:"green",shape:"dot",text:"Holiday On"});
|
||||
return msg;
|
||||
} else {
|
||||
node.status({fill:"red",shape:"ring",text:"Holiday Off"});
|
||||
return null;
|
||||
}
|
18
time-based/old/sunset-lights.js
Normal file
18
time-based/old/sunset-lights.js
Normal file
@ -0,0 +1,18 @@
|
||||
var states = global.get('homeassistant.homeAssistant.states')
|
||||
var sunsetLights = states['input_boolean.sunset_lights_on'].state
|
||||
var weather = states['weather.iron_nerd_weather_station'].state
|
||||
|
||||
if (sunsetLights === 'on') {
|
||||
if (weather === 'sunny' || weather === 'clear-night') {
|
||||
node.status({fill:"green",shape:"dot",text:"Nice Weather"});
|
||||
return[msg,null,null]
|
||||
} else {
|
||||
node.status({fill:"grey",shape:"dot",text:"Shitty Weather"});
|
||||
return[null,msg,null]
|
||||
}
|
||||
} else {
|
||||
node.status({fill:"red",shape:"ring",text:"Disabled"});
|
||||
return[null,null,msg]
|
||||
}
|
||||
|
||||
return msg;
|
26
time-based/old/work-processing.js
Normal file
26
time-based/old/work-processing.js
Normal file
@ -0,0 +1,26 @@
|
||||
var tomorrow = msg.tomorrow
|
||||
var today = msg.today
|
||||
var number = {}
|
||||
var work_tomorrow = {}
|
||||
|
||||
if (tomorrow > 0) {
|
||||
work_tomorrow = "true"
|
||||
if (today == 0) {
|
||||
number = 0
|
||||
} else {
|
||||
number = 1
|
||||
}
|
||||
} else {
|
||||
work_tomorrow = "false"
|
||||
number = 0
|
||||
}
|
||||
|
||||
msg.work_tomorrow = work_tomorrow
|
||||
|
||||
if (number == 0) {
|
||||
node.status({fill:"green",shape:"dot",text:"Number 0"})
|
||||
return[msg,null]
|
||||
} else {
|
||||
node.status({fill:"green",shape:"dot",text:"Number 1"})
|
||||
return[null,msg]
|
||||
}
|
Reference in New Issue
Block a user