Skip to content

Commit

Permalink
Merge pull request #21 from ralfvd/code-cleanup
Browse files Browse the repository at this point in the history
Bugfix of fixed countdown timer changed card. Embarrasing bug ;-)
  • Loading branch information
ralfvd authored Dec 8, 2018
2 parents 96a7b41 + 3e6fa81 commit 2670abd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ If you like the app, consider a donation to support development

### Changelog

- V2.0.2 2018-12-08 : Bugfix of bugfix
- V2.0.1 2018-12-07 : Bugfix for one trigger card
- V2.0.0 2018-12-07 : SDK2 enabled
- V1.2.5 2018-03-18 : Bugfix adjust timer
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": {
"en": "CountDown"
},
"version": "2.0.1",
"version": "2.0.2",
"compatibility": ">=1.5.0",
"sdk": 2,
"description": {
Expand Down
20 changes: 10 additions & 10 deletions lib/flow/triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
let countdown_to_zero = new Homey.FlowCardTrigger('countdown_to_zero');
countdown_to_zero
.registerRunListener((args, state) => {
console.log('countdown_to_zero')
console.log('countdown_to_zero ' + args.variable.name)
//console.log(args); // this is the user input
//console.log(state); // this is the state parameter, as passed in trigger()

Expand All @@ -37,7 +37,7 @@ module.exports = {
let countdown_started = new Homey.FlowCardTrigger('countdown_started');
countdown_started
.registerRunListener((args, state) => {
console.log('countdown_started')
console.log('countdown_started ' + args.variable.name)
//console.log(args); // this is the user input
//console.log(state); // this is the state parameter, as passed in trigger()
// If true, this flow should run
Expand All @@ -53,7 +53,7 @@ module.exports = {
let countdown_stopped = new Homey.FlowCardTrigger('countdown_stopped');
countdown_stopped
.registerRunListener((args, state) => {
console.log('countdown_stopped')
console.log('countdown_stopped ' + args.variable.name)
//console.log(args); // this is the user input
// console.log(state); // this is the state parameter, as passed in trigger()

Expand All @@ -70,7 +70,7 @@ module.exports = {
let countdown_timer_changed = new Homey.FlowCardTrigger('countdown_timer_changed');
countdown_timer_changed
.registerRunListener((args, state) => {
//console.log('countdown_timer_changed')
console.log('countdown_timer_changed ' + args.variable.name)
//console.log(args); // this is the user input
// console.log(state); // this is the state parameter, as passed in trigger()
// If true, this flow should run
Expand All @@ -90,7 +90,7 @@ module.exports = {
let timer_running = new Homey.FlowCardCondition('timer_running');
timer_running
.registerRunListener((args, state) => {
console.log('timer_running')
console.log('timer_running ' + args.variable.name)
//console.log(args.variable); // this is the user input
var result = variableManager.getVariable(args.variable.name);
//console.log(result)
Expand Down Expand Up @@ -148,7 +148,7 @@ module.exports = {
let timer_greater_than_number = new Homey.FlowCardCondition('timer_greater_than_number');
timer_greater_than_number
.registerRunListener((args, state) => {
console.log('timer_greater_than_number')
console.log('timer_greater_than_number ' + args.variable.name)
//console.log(args.variable); // this is the user input
//console.log(state)
var result = variableManager.getVariable(args.variable.name);
Expand All @@ -168,7 +168,7 @@ module.exports = {
let set_countdown_timer = new Homey.FlowCardAction('set_countdown_timer');
set_countdown_timer
.registerRunListener((args, state) => {
console.log('set_countdown_timer')
console.log('set_countdown_timer ' + args.variable.name)
//console.log(args); // this is the user input
//console.log(state); // this is the state parameter, as passed in trigger()

Expand All @@ -190,7 +190,7 @@ module.exports = {
let set_random_countdown_timer = new Homey.FlowCardAction('set_random_countdown_timer');
set_random_countdown_timer
.registerRunListener((args, state) => {
console.log('set_random_countdown_timer')
console.log('set_random_countdown_timer ' + args.variable.name)
//console.log(args); // this is the user input
//console.log(state); // this is the state parameter, as passed in trigger()

Expand All @@ -213,7 +213,7 @@ module.exports = {
let adjust_countdown_timer = new Homey.FlowCardAction('adjust_countdown_timer');
adjust_countdown_timer
.registerRunListener((args, state) => {
//console.log('adjust_countdown_timer ' + args.variable.name)
console.log('adjust_countdown_timer ' + args.variable.name)
//console.log(args); // this is the user input
//console.log(state); // this is the state parameter, as passed in trigger()

Expand All @@ -238,7 +238,7 @@ module.exports = {
let stop_countdown_timer = new Homey.FlowCardAction('stop_countdown_timer');
stop_countdown_timer
.registerRunListener((args, state) => {
console.log('stop_countdown_timer')
console.log('stop_countdown_timer ' + args.variable.name)
//console.log(args); // this is the user input
//console.log(state); // this is the state parameter, as passed in trigger()

Expand Down
4 changes: 2 additions & 2 deletions lib/variablemanagement/variablemanagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ function processValueChanged(variables, oldVariable, newVariable) {
}

//countdown_timer_changed
if (newVariable.value !== oldVariable.value ){
if (newVariable.value !== oldVariable.value && newVariable.value !== -1 ){
//console.log('variablemanager: counttimer changed')
getTrigger('countdown_timer_changed').trigger(null, { "variable": newVariable.name, "value": newVariable.value });
Homey.ManagerFlow.getCard('trigger','countdown_timer_changed').trigger(null, { "variable": newVariable.name, "value": newVariable.value });
// Homey.ManagerFlow.getCard('trigger','countdown_timer_changed').trigger(null, { "variable": newVariable.name, "value": newVariable.value });
}

//countdown_stopped
Expand Down

0 comments on commit 2670abd

Please sign in to comment.