Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw committed May 30, 2024
1 parent fe78448 commit b0df057
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/api-clients/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
]
}
},
"type": "module",
"license": "MIT",
"scripts": {
"clean": "rm -rf .turbo node_modules",
Expand Down
6 changes: 3 additions & 3 deletions packages/api-clients/src/home-assistant/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class HomeAssistant {
this.token = token;
}

async getEntityState(entityId: string) {
async getEntityStateAsync(entityId: string) {
try {
const response = await fetch(
appendPath(this.basePath, `/states/${entityId}`),
Expand All @@ -43,7 +43,7 @@ export class HomeAssistant {
}
}

async triggerAutomation(entityId: string) {
async triggerAutomationAsync(entityId: string) {
try {
const response = await fetch(
appendPath(this.basePath, `/services/automation/trigger`),
Expand All @@ -70,7 +70,7 @@ export class HomeAssistant {
* @param entityId - The ID of the entity to toggle.
* @returns A boolean indicating whether the toggle action was successful.
*/
async triggerToggle(entityId: string) {
async triggerToggleAsync(entityId: string) {
try {
const response = await fetch(
appendPath(this.basePath, `/services/homeassistant/toggle`),
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/router/widgets/smart-home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const smartHomeRouter = createTRPCRouter({
});

setInterval(() => {
void homeAssistantEntityState.publish({
void homeAssistantEntityState.publishAsync({
entityId: input.entityId,
state: `${randomInt(0, 1000)}mV`,
});
Expand All @@ -51,6 +51,6 @@ export const smartHomeRouter = createTRPCRouter({
}

const homeAssistant = new HomeAssistant(new URL(integration.url), integration.secrets[0]!.value);
await homeAssistant.triggerAutomation(input.automationId);
await homeAssistant.triggerAutomationAsync(input.automationId);
}),
});

0 comments on commit b0df057

Please sign in to comment.