Skip to content

Commit

Permalink
fixing typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed May 17, 2020
1 parent e5cccc8 commit 704bda6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions src/puckPlatformAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type {
import {FlairPlatform} from './platform';
import {Puck} from 'flair-api-ts/lib/client/models';
import Client from 'flair-api-ts/lib/client';
import {Pressure, PressureSensor} from './Pressure';
import {getRandomIntInclusive} from './utils';

/**
Expand All @@ -18,7 +17,6 @@ export class FlairPuckPlatformAccessory {
private temperatureService: Service;
private humidityService: Service;
private accessoryInformationService: Service;
private pressureService: Service;

private client: Client;
private puck: Puck;
Expand Down Expand Up @@ -54,13 +52,6 @@ export class FlairPuckPlatformAccessory {
this.humidityService.setCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.puck.currentHumidity);
this.temperatureService.addLinkedService(this.humidityService);

//Add our custom pressure sensor
this.pressureService = this.accessory.getService(PressureSensor)
?? this.accessory.addService(PressureSensor);
this.pressureService.setCharacteristic(this.platform.Characteristic.Name, accessory.context.device.name);
this.pressureService.setCharacteristic(Pressure, this.puck.currentRoomPressure);
this.temperatureService.addLinkedService(this.pressureService);

setInterval(async () => {
await this.getNewPuckReadings();
}, (platform.config.pollInterval + getRandomIntInclusive(1, 20)) * 1000);
Expand All @@ -87,7 +78,6 @@ export class FlairPuckPlatformAccessory {
// push the new value to HomeKit
this.temperatureService.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.puck.currentTemperatureC);
this.humidityService.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.puck.currentHumidity);
this.pressureService.updateCharacteristic(Pressure, this.puck.currentRoomPressure);

this.accessory.getService(this.platform.Service.AccessoryInformation)!
.updateCharacteristic(this.platform.Characteristic.FirmwareRevision, this.puck.firmwareVersionS);
Expand Down
2 changes: 1 addition & 1 deletion src/ventPlatformAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class FlairVentPlatformAccessory {
this.platform.Characteristic.CurrentTemperature,
this.vent.ductTemperatureC,
);

// We fake a vent as a window covering.
switch (this.accessoryType) {
case AccessoryType.WindowCovering:
Expand Down

0 comments on commit 704bda6

Please sign in to comment.