Skip to content

Commit

Permalink
chore: removed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jasper-seinhorst committed Mar 4, 2024
1 parent b69a17e commit b54ae2e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,36 @@ export class HomewizardPowerConsumption implements DynamicPlatformPlugin {
private setupAccessoires() {

const powerConsumptionUuid = this.api.hap.uuid.generate('homewizard-power-consumption');
const powerConsumptionExsistingAccessory = this.accessories.find(accessory => accessory.UUID === powerConsumptionUuid);
const powerConsumptionExistingAccessory = this.accessories.find(accessory => accessory.UUID === powerConsumptionUuid);
if (this.config.hidePowerConsumptionDevice !== true) {
if (powerConsumptionExsistingAccessory) {
this.devices.push(new PowerConsumption(this.config, this.log, this.api, powerConsumptionExsistingAccessory));
if (powerConsumptionExistingAccessory) {
this.devices.push(new PowerConsumption(this.config, this.log, this.api, powerConsumptionExistingAccessory));
} else {
this.log.info('Power Consumption added as accessory');
const accessory = new this.api.platformAccessory('Power Consumption', powerConsumptionUuid);
this.devices.push(new PowerConsumption(this.config, this.log, this.api, accessory));
this.api.registerPlatformAccessories('homebridge-homewizard-power-consumption', 'HomewizardPowerConsumption', [accessory]);
}
} else {
if (powerConsumptionExsistingAccessory) {
this.api.unregisterPlatformAccessories(powerConsumptionUuid, 'homebridge-homewizard-power-consumption', [powerConsumptionExsistingAccessory]);
if (powerConsumptionExistingAccessory) {
this.api.unregisterPlatformAccessories(powerConsumptionUuid, 'homebridge-homewizard-power-consumption', [powerConsumptionExistingAccessory]);
}
}

const powerReturnUuid = this.api.hap.uuid.generate('homewizard-power-return');
const powerReturnExsistingAccessory = this.accessories.find(accessory => accessory.UUID === powerReturnUuid);
const powerReturnExistingAccessory = this.accessories.find(accessory => accessory.UUID === powerReturnUuid);
if (this.config.hidePowerReturnDevice !== true) {
if (powerReturnExsistingAccessory) {
this.devices.push(new PowerReturn(this.config, this.log, this.api, powerReturnExsistingAccessory));
if (powerReturnExistingAccessory) {
this.devices.push(new PowerReturn(this.config, this.log, this.api, powerReturnExistingAccessory));
} else {
this.log.info('Power Return added as accessory');
const accessory = new this.api.platformAccessory('Power Return', powerReturnUuid);
this.devices.push(new PowerReturn(this.config, this.log, this.api, accessory));
this.api.registerPlatformAccessories('homebridge-homewizard-power-consumption', 'HomewizardPowerConsumption', [accessory]);
}
} else {
if (powerReturnExsistingAccessory) {
this.api.unregisterPlatformAccessories(powerReturnUuid, 'homebridge-homewizard-power-consumption', [powerReturnExsistingAccessory]);
if (powerReturnExistingAccessory) {
this.api.unregisterPlatformAccessories(powerReturnUuid, 'homebridge-homewizard-power-consumption', [powerReturnExistingAccessory]);
}
}
}
Expand Down

0 comments on commit b54ae2e

Please sign in to comment.