Current state of K's activity timer
This commit is contained in:
21
kallen-timer/start.js
Normal file
21
kallen-timer/start.js
Normal file
@ -0,0 +1,21 @@
|
||||
var states = global.get('homeassistant.homeAssistant.states')
|
||||
var room = states['input_select.kallen_activity_room'].state
|
||||
var activity = states['input_select.kallen_activities'].state
|
||||
var controlLights = states['input_boolean.kallen_timer_control_lights'].state
|
||||
var duration = states['input_number.kallen_activity_duration'].state
|
||||
var fixDuration = parseFloat(duration)
|
||||
|
||||
msg.room = room
|
||||
msg.activity = activity
|
||||
msg.lights = controlLights
|
||||
msg.duration = fixDuration
|
||||
|
||||
node.status({fill:"green",shape:"dot",text:room})
|
||||
|
||||
if (room === 'Basement') {
|
||||
return[msg,null,null]
|
||||
} else if (room === 'Kallen Bedroom') {
|
||||
return [null,msg,null]
|
||||
} else {
|
||||
return[null,null,msg]
|
||||
}
|
Reference in New Issue
Block a user