Skip to content

Commit

Permalink
Adjust scope endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Jul 4, 2024
1 parent 295906a commit ccc5f1f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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 }) => {
Expand Down Expand Up @@ -112,7 +112,7 @@ export class TeslaFleetApiPlatform implements DynamicPlatformPlugin {
product.site_name,
uuid,
Categories.OTHER
)
);
newAccessories.push(accessory);
}

Expand All @@ -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
)
})
);
});
});
}

Expand Down

0 comments on commit ccc5f1f

Please sign in to comment.