feat(integrations): add mock integration (#3505)
This commit is contained in:
1 parent
350a531d32
commit
58d5b14c51
73 files changed
+1049
-156
No files matched your search
@@ -0,0 +1,7 @@
|
||||
import type { EntityStateResult } from "./smart-home-types";
|
||||
|
||||
export interface ISmartHomeIntegration {
|
||||
getEntityStateAsync(entityId: string): Promise<EntityStateResult>;
|
||||
triggerAutomationAsync(entityId: string): Promise<boolean>;
|
||||
triggerToggleAsync(entityId: string): Promise<boolean>;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
interface EntityState {
|
||||
attributes: Record<string, string | number | boolean | null | (string | number)[]>;
|
||||
entity_id: string;
|
||||
last_changed: Date;
|
||||
last_updated: Date;
|
||||
state: string;
|
||||
}
|
||||
|
||||
export type EntityStateResult =
|
||||
| {
|
||||
success: true;
|
||||
data: EntityState;
|
||||
}
|
||||
| {
|
||||
success: false;
|
||||
error: unknown;
|
||||
};
|
||||
Reference in new issue
Block a user