15 lines
516 B
JavaScript
15 lines
516 B
JavaScript
const states = global.get('homeassistant.homeAssistant.states')
|
|
const timer = states['timer.kallen_timer'].state
|
|
|
|
// Basic replacement for current entry flow
|
|
|
|
if (timer === 'idle') {
|
|
node.status({fill:"green",shape:"dot",text:"Start"})
|
|
node.send([msg,null,null])
|
|
} else if (timer === 'active') {
|
|
node.status({fill:"yellow",shape:"dot",text:"Pause"})
|
|
node.send([null,msg,null])
|
|
} else if (timer === 'paused') {
|
|
node.status({fill:"green",shape:"dot",text:"Resume"})
|
|
node.send([null,null,msg])
|
|
} |