Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jasper-seinhorst committed Feb 8, 2024
1 parent f270760 commit 90c0c8c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
# the Node.js versions to build on
node-version: [14.x, 16.x, 18.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 0 additions & 5 deletions .vscode/extensions.json

This file was deleted.

8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

13 changes: 9 additions & 4 deletions src/Platform.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic } from 'homebridge';
import { Battery, Charger, DirectClimatisation } from './Accessories';
import PorscheConnect, { EngineType } from 'porsche-connect';
import PorscheConnect, { EngineType, Environment } from 'porsche-connect';

Check warning on line 3 in src/Platform.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

'Environment' is defined but never used

Check warning on line 3 in src/Platform.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

'Environment' is defined but never used
import { PlatformVehicle, PorscheAccessory } from './PlatformTypes';

export class PorscheTaycanPlatform implements DynamicPlatformPlugin {
Expand Down Expand Up @@ -33,16 +33,18 @@ export class PorscheTaycanPlatform implements DynamicPlatformPlugin {
}

try {
// 'nl', 'nl_NL', 'Europe/Amsterdam'
this.log.info('Authentication');
this.PorscheConnectAuth = new PorscheConnect({ username: this.config.username, password: this.config.password });
this.log.info('Retrieving available vehicles');
await this.discoverVehicles();
this.PorscheConnectAuth = new PorscheConnect({ username: this.config.username, password: this.config.password});
} catch (error) {
this.log.error('Porsche Connect connection failed');
this.log.debug('Reason: ', error);
}

this.log.info('Retrieving available vehicles');
await this.discoverVehicles();
await this.heartBeat();

setInterval(() => {
this.heartBeat();
}, this.heartBeatInterval);
Expand All @@ -51,6 +53,9 @@ export class PorscheTaycanPlatform implements DynamicPlatformPlugin {
private async discoverVehicles() {
if (this.PorscheConnectAuth) {
const vehicles = await this.PorscheConnectAuth.getVehicles();

console.log(vehicles);

Check warning on line 57 in src/Platform.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected console statement

Check warning on line 57 in src/Platform.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected console statement

for (const vehicle of vehicles) {
if (vehicle.engineType === EngineType.BatteryPowered) {
const platformVehicle: PlatformVehicle = { vehicle, accessories: [] };
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sourceMap": false,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"strict": false,
"esModuleInterop": true,
"noImplicitAny": false
},
Expand Down

0 comments on commit 90c0c8c

Please sign in to comment.