diff --git a/src/platform.ts b/src/platform.ts index d5e8912..5df7344 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -9,9 +9,9 @@ import { Service, } from "homebridge"; +import { EnergyAccessory, EnergyContext } from "./energy.js"; import { PLATFORM_NAME, PLUGIN_NAME } from "./settings.js"; import { VehicleAccessory, VehicleContext } from "./vehicle.js"; -import { EnergyAccessory, EnergyContext } from "./energy.js"; import { Tessie } from "tesla-fleet-api"; @@ -54,7 +54,7 @@ export class TeslaFleetApiPlatform implements DynamicPlatformPlugin { log.debug("Executed didFinishLaunching callback"); // run the method to discover / register your devices as accessories - const { scopes } = await this.TeslaFleetApi.metadata(); + const scopes = await this.TeslaFleetApi.tesla_scopes(); await this.TeslaFleetApi.products_by_type() .then(async ({ vehicles, energy_sites }) => { @@ -112,7 +112,7 @@ export class TeslaFleetApiPlatform implements DynamicPlatformPlugin { product.site_name, uuid, Categories.OTHER - ) + ); newAccessories.push(accessory); } @@ -123,18 +123,18 @@ export class TeslaFleetApiPlatform implements DynamicPlatformPlugin { accessory.displayName = product.site_name; new EnergyAccessory(this, accessory); - }) + }); } - return newAccessories + return newAccessories; }).then((newAccessories) => { this.api.registerPlatformAccessories( PLUGIN_NAME, PLATFORM_NAME, newAccessories - ) - }) + ); + }); }); }