1 | import { Auth } from "./auth.js";
|
2 | import { HaWebSocket } from "./socket.js";
|
3 | export declare type Error = 1 | 2 | 3 | 4;
|
4 | export declare type UnsubscribeFunc = () => void;
|
5 | export declare type ConnectionOptions = {
|
6 | setupRetry: number;
|
7 | auth?: Auth;
|
8 | createSocket: (options: ConnectionOptions) => Promise<HaWebSocket>;
|
9 | };
|
10 | export declare type MessageBase = {
|
11 | id?: number;
|
12 | type: string;
|
13 | [key: string]: any;
|
14 | };
|
15 | export declare type HassEventBase = {
|
16 | origin: string;
|
17 | time_fired: string;
|
18 | context: {
|
19 | id: string;
|
20 | user_id: string;
|
21 | };
|
22 | };
|
23 | export declare type HassEvent = HassEventBase & {
|
24 | event_type: string;
|
25 | data: {
|
26 | [key: string]: any;
|
27 | };
|
28 | };
|
29 | export declare type StateChangedEvent = HassEventBase & {
|
30 | event_type: "state_changed";
|
31 | data: {
|
32 | entity_id: string;
|
33 | new_state: HassEntity | null;
|
34 | old_state: HassEntity | null;
|
35 | };
|
36 | };
|
37 | export declare type HassConfig = {
|
38 | latitude: number;
|
39 | longitude: number;
|
40 | elevation: number;
|
41 | unit_system: {
|
42 | length: string;
|
43 | mass: string;
|
44 | volume: string;
|
45 | temperature: string;
|
46 | };
|
47 | location_name: string;
|
48 | time_zone: string;
|
49 | components: string[];
|
50 | config_dir: string;
|
51 | whitelist_external_dirs: string[];
|
52 | version: string;
|
53 | config_source: string;
|
54 | safe_mode: boolean;
|
55 | };
|
56 | export declare type HassEntityBase = {
|
57 | entity_id: string;
|
58 | state: string;
|
59 | last_changed: string;
|
60 | last_updated: string;
|
61 | attributes: HassEntityAttributeBase;
|
62 | context: {
|
63 | id: string;
|
64 | user_id: string | null;
|
65 | };
|
66 | };
|
67 | export declare type HassEntityAttributeBase = {
|
68 | friendly_name?: string;
|
69 | unit_of_measurement?: string;
|
70 | icon?: string;
|
71 | entity_picture?: string;
|
72 | supported_features?: number;
|
73 | hidden?: boolean;
|
74 | assumed_state?: boolean;
|
75 | device_class?: string;
|
76 | };
|
77 | export declare type HassEntity = HassEntityBase & {
|
78 | attributes: {
|
79 | [key: string]: any;
|
80 | };
|
81 | };
|
82 | export declare type HassEntities = {
|
83 | [entity_id: string]: HassEntity;
|
84 | };
|
85 | export declare type HassService = {
|
86 | description: string;
|
87 | fields: {
|
88 | [field_name: string]: {
|
89 | description: string;
|
90 | example: string | boolean | number;
|
91 | };
|
92 | };
|
93 | };
|
94 | export declare type HassDomainServices = {
|
95 | [service_name: string]: HassService;
|
96 | };
|
97 | export declare type HassServices = {
|
98 | [domain: string]: HassDomainServices;
|
99 | };
|
100 | export declare type HassUser = {
|
101 | id: string;
|
102 | is_owner: boolean;
|
103 | name: string;
|
104 | };
|