Skip to content

Commit

Permalink
Make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
aivus committed Sep 27, 2024
1 parent ed5d482 commit db72699
Showing 1 changed file with 37 additions and 27 deletions.
64 changes: 37 additions & 27 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit db72699

Please sign in to comment.