diff --git a/app.js b/app.js index d2d34d8..fa114ef 100644 --- a/app.js +++ b/app.js @@ -83,66 +83,76 @@ class GreeHVAC extends Homey.App { // Register actions for flows this.homey.flow.getActionCard('set_hvac_mode') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('thermostat_mode', args.mode).then(() => { - return args.device.triggerCapabilityListener('thermostat_mode', args.mode, {}); - }); + return args.device.setCapabilityValue('thermostat_mode', args.mode) + .then(() => { + return args.device.triggerCapabilityListener('thermostat_mode', args.mode, {}); + }); }); this.homey.flow.getActionCard('set_fan_speed') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('fan_speed', args.speed).then(() => { - return args.device.triggerCapabilityListener('fan_speed', args.speed, {}); - }); + return args.device.setCapabilityValue('fan_speed', args.speed) + .then(() => { + return args.device.triggerCapabilityListener('fan_speed', args.speed, {}); + }); }); this.homey.flow.getActionCard('set_turbo_mode') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('turbo_mode', onoffToBoolean(args.mode)).then(() => { - return args.device.triggerCapabilityListener('turbo_mode', onoffToBoolean(args.mode), {}); - }); + return args.device.setCapabilityValue('turbo_mode', onoffToBoolean(args.mode)) + .then(() => { + return args.device.triggerCapabilityListener('turbo_mode', onoffToBoolean(args.mode), {}); + }); }); this.homey.flow.getActionCard('set_safety_heating') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('safety_heating', onoffToBoolean(args.mode)).then(() => { - return args.device.triggerCapabilityListener('safety_heating', onoffToBoolean(args.mode), {}); - }); + return args.device.setCapabilityValue('safety_heating', onoffToBoolean(args.mode)) + .then(() => { + return args.device.triggerCapabilityListener('safety_heating', onoffToBoolean(args.mode), {}); + }); }); this.homey.flow.getActionCard('set_lights') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('lights', onoffToBoolean(args.mode)).then(() => { - return args.device.triggerCapabilityListener('lights', onoffToBoolean(args.mode), {}); - }); + return args.device.setCapabilityValue('lights', onoffToBoolean(args.mode)) + .then(() => { + return args.device.triggerCapabilityListener('lights', onoffToBoolean(args.mode), {}); + }); }); this.homey.flow.getActionCard('set_xfan_mode') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('xfan_mode', onoffToBoolean(args.mode)).then(() => { - return args.device.triggerCapabilityListener('xfan_mode', onoffToBoolean(args.mode), {}); - }); + return args.device.setCapabilityValue('xfan_mode', onoffToBoolean(args.mode)) + .then(() => { + return args.device.triggerCapabilityListener('xfan_mode', onoffToBoolean(args.mode), {}); + }); }); this.homey.flow.getActionCard('set_vertical_swing') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('vertical_swing', args.vertical_swing).then(() => { - return args.device.triggerCapabilityListener('vertical_swing', args.vertical_swing, {}); - }); + return args.device.setCapabilityValue('vertical_swing', args.vertical_swing) + .then(() => { + return args.device.triggerCapabilityListener('vertical_swing', args.vertical_swing, {}); + }); }); this.homey.flow.getActionCard('set_horizontal_swing') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('horizontal_swing', args.horizontal_swing).then(() => { - return args.device.triggerCapabilityListener('horizontal_swing', args.horizontal_swing, {}); - }); + return args.device.setCapabilityValue('horizontal_swing', args.horizontal_swing) + .then(() => { + return args.device.triggerCapabilityListener('horizontal_swing', args.horizontal_swing, {}); + }); }); this.homey.flow.getActionCard('set_quiet_mode') .registerRunListener((args, state) => { - return args.device.setCapabilityValue('quiet_mode', args.mode).then(() => { - return args.device.triggerCapabilityListener('quiet_mode', args.mode, {}); - }); + return args.device.setCapabilityValue('quiet_mode', args.mode) + .then(() => { + return args.device.triggerCapabilityListener('quiet_mode', args.mode, {}); + }); }); } + } function onoffToBoolean(value) {