Skip to content

Commit

Permalink
Migrate class for existing devices
Browse files Browse the repository at this point in the history
  • Loading branch information
aivus committed Sep 20, 2024
1 parent 018125e commit 067e8be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gree_cooper_hunter_hvac/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class GreeHVACDevice extends Homey.Device {
this._flowTriggerQuietModeChanged = this.homey.flow.getDeviceTriggerCard('quiet_mode_changed');

await this._executeCapabilityMigrations();
await this._executeDeviceClassMigration();
this._registerCapabilityListeners();

this._markOffline();
Expand Down Expand Up @@ -616,6 +617,12 @@ class GreeHVACDevice extends Homey.Device {
}
}

async _executeDeviceClassMigration() {
if (this.getClass() !== 'airconditioning') {
await this.setClass('airconditioning').catch(this.error);
}
}

/**
* Set value for the specific property of the HVAC _client
*
Expand Down

0 comments on commit 067e8be

Please sign in to comment.