Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into update-gree-hvac-cl…
Browse files Browse the repository at this point in the history
…ient
  • Loading branch information
aivus committed Sep 20, 2024
2 parents 59fda80 + 018125e commit 93c6252
Show file tree
Hide file tree
Showing 10 changed files with 753 additions and 1,418 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/homey-validation.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Homey validation

on: push
on:
push:
pull_request:

jobs:
publish-validation:
name: Validate Homey App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aivus/homey-validate-action@v1
- uses: athombv/github-action-homey-app-validate@v1
with:
level: publish
3 changes: 3 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@
},
"0.8.0": {
"en": "Fix issues with control thermostat using Homey Pro 2023.\r\nAdd \"Horizontal swing\" capability\r\nAdd \"Quite Mode\" capability\r\nThanks to @denniedegroot for all these changes"
},
"0.8.1": {
"en": "Improve compatibility with Homey Pro 2023\r\nDeprecate \"hvac mode\" flow cards (must be replaced by \"thermostat mode\")\r\nFix \"quiet mode\" condition\r\nBumped minimum supported version of Homey firmware to v12.0.1"
}
}
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ This app is an Open Source Software developed in free time by one developer.

If you want to thank the author of this app you can use [GitHub Sponsors](https://github.com/aivus/com.gree?sponsor=1) or [Patreon](https://patreon.com/aivus)

## Supported devices
* Gree Wi-Fi HVACs
* Argo Wi-Fi HVACs
* Cooper&Hunter Wi-Fi HVACs
* Daitsu Wi-Fi HVACs
* Tosot Wi-Fi HVACs
* Wilfa Wi-Fi HVACs
* Innova Wi-Fi HVACs
## Supported Wi-Fi HVACs
* Gree
* Argo
* Cooper&Hunter
* Daitsu
* Tosot
* Wilfa
* Innova
* Tadiran
* Copmax

*This app is tested using Cooper&Hunter Alpha CH-S18FTXE*

Expand Down
18 changes: 10 additions & 8 deletions README.nl.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Deze app voegt ondersteuning van Gree-compatibele HVAC's toe aan Homey.

Ondersteunde apparaten:
* Gree Wi-Fi HVAC's
* Argo Wi-Fi HVAC's
* Cooper&Hunter Wi-Fi HVAC's
* Daitsu Wi-Fi HVAC's
* Tosot Wi-Fi HVAC's
* Wilfa Wi-Fi HVAC's
* Innova Wi-Fi HVAC's
Ondersteunde Wi-Fi HVAC's:
* Gree
* Argo
* Cooper&Hunter
* Daitsu
* Tosot
* Wilfa
* Innova
* Tadiran
* Copmax

Als je hebt vastgesteld dat je HVAC werkt met deze app en je ziet het merk hierboven niet terug, maak dan a.u.b. een ticket aan zodat we de ondersteuning voor dit merk kunnen vermelden.

Expand Down
18 changes: 10 additions & 8 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
This app adds support of Gree compatible HVACs to Homey.

Supported devices:
* Gree Wi-Fi HVACs
* Argo Wi-Fi HVACs
* Cooper&Hunter Wi-Fi HVACs
* Daitsu Wi-Fi HVACs
* Tosot Wi-Fi HVACs
* Wilfa Wi-Fi HVACs
* Innova Wi-Fi HVACs
Supported Wi-Fi HVACs:
* Gree
* Argo
* Cooper&Hunter
* Daitsu
* Tosot
* Wilfa
* Innova
* Tadiran
* Copmax

If you found that your HVAC works and brand is not mentioned above please create an issue to add this brand as compatible

Expand Down
48 changes: 27 additions & 21 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,117 +7,123 @@ const { Log } = require('homey-log');
class GreeHVAC extends Homey.App {

async onInit() {
this.homeyLog = new Log({ homey: this.homey, options: { autoBreadcrumbs: true } });
this.homeyLog = new Log({
homey: this.homey,
options: {
autoBreadcrumbs: true,
release: Homey.manifest.version,
},
});
this.log('Gree HVAC app is up and running...');

// Register conditions for flows
this._conditionHVACModeIs = this.homey.flow.getConditionCard('hvac_mode_is')
this.homey.flow.getConditionCard('hvac_mode_is')
.registerRunListener((args, state) => {
const hvacMode = args.device.getCapabilityValue('hvac_mode');
const hvacMode = args.device.getCapabilityValue('thermostat_mode');
args.device.log('[condition]', '[current hvac mode]', hvacMode);
return args.mode === hvacMode;
});

this._conditionFanSpeedIs = this.homey.flow.getConditionCard('fan_speed_is')
this.homey.flow.getConditionCard('fan_speed_is')
.registerRunListener((args, state) => {
const fanSpeed = args.device.getCapabilityValue('fan_speed');
args.device.log('[condition]', '[current fan speed]', fanSpeed);
return args.speed === fanSpeed;
});

this._conditionTurboModeIs = this.homey.flow.getConditionCard('turbo_mode_is')
this.homey.flow.getConditionCard('turbo_mode_is')
.registerRunListener((args, state) => {
const turboMode = args.device.getCapabilityValue('turbo_mode');
args.device.log('[condition]', '[current turbo mode]', turboMode);
return onoffToBoolean(args.mode) === turboMode;
});

this._conditionLightsIs = this.homey.flow.getConditionCard('lights_is')
this.homey.flow.getConditionCard('lights_is')
.registerRunListener((args, state) => {
const lightsMode = args.device.getCapabilityValue('lights');
args.device.log('[condition]', '[current lights]', lightsMode);
return onoffToBoolean(args.mode) === lightsMode;
});

this._conditionXFanModeIs = this.homey.flow.getConditionCard('xfan_mode_is')
this.homey.flow.getConditionCard('xfan_mode_is')
.registerRunListener((args, state) => {
const xfanMode = args.device.getCapabilityValue('xfan_mode');
args.device.log('[condition]', '[current xfan mode]', xfanMode);
return onoffToBoolean(args.mode) === xfanMode;
});

this._conditionVerticalSwingIs = this.homey.flow.getConditionCard('vertical_swing_is')
this.homey.flow.getConditionCard('vertical_swing_is')
.registerRunListener((args, state) => {
const verticalSwing = args.device.getCapabilityValue('vertical_swing');
args.device.log('[condition]', '[current swing vertical]', verticalSwing);
return args.vertical_swing === verticalSwing;
});

this._conditionHorizontalSwingIs = this.homey.flow.getConditionCard('horizontal_swing_is')
this.homey.flow.getConditionCard('horizontal_swing_is')
.registerRunListener((args, state) => {
const horizontalSwing = args.device.getCapabilityValue('horizontal_swing');
args.device.log('[condition]', '[current swing horizontal]', horizontalSwing);
return args.horizontal_swing === horizontalSwing;
});

this._conditionQuietModeIs = this.homey.flow.getConditionCard('quiet_mode_is')
this.homey.flow.getConditionCard('quiet_mode_is')
.registerRunListener((args, state) => {
const quietMode = args.device.getCapabilityValue('quiet_mode_is');
const quietMode = args.device.getCapabilityValue('quiet_mode');
args.device.log('[condition]', '[quiet mode]', quietMode);
return args.mode === quietMode;
});

// Register actions for flows
this._actionChangeHVACMode = this.homey.flow.getActionCard('set_hvac_mode')
this.homey.flow.getActionCard('set_hvac_mode')
.registerRunListener((args, state) => {
return args.device.setCapabilityValue('hvac_mode', args.mode).then(() => {
return args.device.triggerCapabilityListener('hvac_mode', args.mode, {});
return args.device.setCapabilityValue('thermostat_mode', args.mode).then(() => {
return args.device.triggerCapabilityListener('thermostat_mode', args.mode, {});
});
});

this._actionChangeFanSpeed = this.homey.flow.getActionCard('set_fan_speed')
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, {});
});
});

this._actionChangeTurboMode = this.homey.flow.getActionCard('set_turbo_mode')
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), {});
});
});

this._actionChangeLights = this.homey.flow.getActionCard('set_lights')
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), {});
});
});

this._actionChangeXFanMode = this.homey.flow.getActionCard('set_xfan_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), {});
});
});

this._actionChangeVerticalSwing = this.homey.flow.getActionCard('set_vertical_swing')
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, {});
});
});

this._actionChangeHorizontalSwing = this.homey.flow.getActionCard('set_horizontal_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, {});
});
});

this._actionChangeQuietMode = this.homey.flow.getActionCard('set_quiet_mode')
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, {});
Expand Down
Loading

0 comments on commit 93c6252

Please sign in to comment.