@mehrwiedu/dreo-api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CapabilityMerger.d.ts +4 -0
- package/dist/CapabilityMerger.js +31 -0
- package/dist/CapabilityMerger.js.map +1 -0
- package/dist/DeviceCapabilityResolver.d.ts +9 -0
- package/dist/DeviceCapabilityResolver.js +73 -0
- package/dist/DeviceCapabilityResolver.js.map +1 -0
- package/dist/DeviceResolver.d.ts +13 -0
- package/dist/DeviceResolver.js +64 -0
- package/dist/DeviceResolver.js.map +1 -0
- package/dist/DreoCapabilityRegistry.d.ts +13 -0
- package/dist/DreoCapabilityRegistry.js +57 -0
- package/dist/DreoCapabilityRegistry.js.map +1 -0
- package/dist/DreoClient.d.ts +63 -0
- package/dist/DreoClient.js +210 -0
- package/dist/DreoClient.js.map +1 -0
- package/dist/DreoDevice.d.ts +41 -0
- package/dist/DreoDevice.js +147 -0
- package/dist/DreoDevice.js.map +1 -0
- package/dist/DreoLogger.d.ts +7 -0
- package/dist/DreoLogger.js +15 -0
- package/dist/DreoLogger.js.map +1 -0
- package/dist/DreoSession.d.ts +31 -0
- package/dist/DreoSession.js +81 -0
- package/dist/DreoSession.js.map +1 -0
- package/dist/DreoSessionObserver.d.ts +12 -0
- package/dist/DreoSessionObserver.js +2 -0
- package/dist/DreoSessionObserver.js.map +1 -0
- package/dist/DreoStateRegistry.d.ts +3 -0
- package/dist/DreoStateRegistry.js +302 -0
- package/dist/DreoStateRegistry.js.map +1 -0
- package/dist/InputValidator.d.ts +15 -0
- package/dist/InputValidator.js +30 -0
- package/dist/InputValidator.js.map +1 -0
- package/dist/ResolvedDeviceResolver.d.ts +12 -0
- package/dist/ResolvedDeviceResolver.js +54 -0
- package/dist/ResolvedDeviceResolver.js.map +1 -0
- package/dist/StateConstraintResolver.d.ts +15 -0
- package/dist/StateConstraintResolver.js +169 -0
- package/dist/StateConstraintResolver.js.map +1 -0
- package/dist/StateConstraintValidator.d.ts +9 -0
- package/dist/StateConstraintValidator.js +79 -0
- package/dist/StateConstraintValidator.js.map +1 -0
- package/dist/StateMapper.d.ts +17 -0
- package/dist/StateMapper.js +84 -0
- package/dist/StateMapper.js.map +1 -0
- package/dist/api/AppApi.d.ts +7 -0
- package/dist/api/AppApi.js +10 -0
- package/dist/api/AppApi.js.map +1 -0
- package/dist/api/AuthenticatedHttpClient.d.ts +14 -0
- package/dist/api/AuthenticatedHttpClient.js +54 -0
- package/dist/api/AuthenticatedHttpClient.js.map +1 -0
- package/dist/api/DeviceApi.d.ts +9 -0
- package/dist/api/DeviceApi.js +24 -0
- package/dist/api/DeviceApi.js.map +1 -0
- package/dist/api/HttpClient.d.ts +15 -0
- package/dist/api/HttpClient.js +41 -0
- package/dist/api/HttpClient.js.map +1 -0
- package/dist/api/UserApi.d.ts +1 -0
- package/dist/api/UserApi.js +2 -0
- package/dist/api/UserApi.js.map +1 -0
- package/dist/auth/AuthManager.d.ts +16 -0
- package/dist/auth/AuthManager.js +27 -0
- package/dist/auth/AuthManager.js.map +1 -0
- package/dist/auth/LoginRequestBuilder.d.ts +5 -0
- package/dist/auth/LoginRequestBuilder.js +18 -0
- package/dist/auth/LoginRequestBuilder.js.map +1 -0
- package/dist/auth/TokenStore.d.ts +1 -0
- package/dist/auth/TokenStore.js +2 -0
- package/dist/auth/TokenStore.js.map +1 -0
- package/dist/crypto/PasswordHasher.d.ts +3 -0
- package/dist/crypto/PasswordHasher.js +7 -0
- package/dist/crypto/PasswordHasher.js.map +1 -0
- package/dist/crypto/Signer.d.ts +1 -0
- package/dist/crypto/Signer.js +2 -0
- package/dist/crypto/Signer.js.map +1 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/mappers/DeviceStateMapper.d.ts +8 -0
- package/dist/mappers/DeviceStateMapper.js +27 -0
- package/dist/mappers/DeviceStateMapper.js.map +1 -0
- package/dist/mappers/FamilyTreeMapper.d.ts +8 -0
- package/dist/mappers/FamilyTreeMapper.js +50 -0
- package/dist/mappers/FamilyTreeMapper.js.map +1 -0
- package/dist/models/AuthTokens.d.ts +4 -0
- package/dist/models/AuthTokens.js +2 -0
- package/dist/models/AuthTokens.js.map +1 -0
- package/dist/models/Commands.d.ts +1 -0
- package/dist/models/Commands.js +2 -0
- package/dist/models/Commands.js.map +1 -0
- package/dist/models/Device.d.ts +19 -0
- package/dist/models/Device.js +2 -0
- package/dist/models/Device.js.map +1 -0
- package/dist/models/DeviceCapabilities.d.ts +7 -0
- package/dist/models/DeviceCapabilities.js +2 -0
- package/dist/models/DeviceCapabilities.js.map +1 -0
- package/dist/models/DeviceListResponse.d.ts +8 -0
- package/dist/models/DeviceListResponse.js +2 -0
- package/dist/models/DeviceListResponse.js.map +1 -0
- package/dist/models/DeviceState.d.ts +12 -0
- package/dist/models/DeviceState.js +2 -0
- package/dist/models/DeviceState.js.map +1 -0
- package/dist/models/DeviceStateResponse.d.ts +20 -0
- package/dist/models/DeviceStateResponse.js +2 -0
- package/dist/models/DeviceStateResponse.js.map +1 -0
- package/dist/models/DeviceSummary.d.ts +11 -0
- package/dist/models/DeviceSummary.js +2 -0
- package/dist/models/DeviceSummary.js.map +1 -0
- package/dist/models/DiscoveredState.d.ts +18 -0
- package/dist/models/DiscoveredState.js +2 -0
- package/dist/models/DiscoveredState.js.map +1 -0
- package/dist/models/DreoDeviceState.d.ts +15 -0
- package/dist/models/DreoDeviceState.js +2 -0
- package/dist/models/DreoDeviceState.js.map +1 -0
- package/dist/models/Family.d.ts +14 -0
- package/dist/models/Family.js +2 -0
- package/dist/models/Family.js.map +1 -0
- package/dist/models/FamilyRoomDevicesResponse.d.ts +10 -0
- package/dist/models/FamilyRoomDevicesResponse.js +2 -0
- package/dist/models/FamilyRoomDevicesResponse.js.map +1 -0
- package/dist/models/FamilyTree.d.ts +19 -0
- package/dist/models/FamilyTree.js +2 -0
- package/dist/models/FamilyTree.js.map +1 -0
- package/dist/models/LoginResponse.d.ts +9 -0
- package/dist/models/LoginResponse.js +2 -0
- package/dist/models/LoginResponse.js.map +1 -0
- package/dist/models/ResolvedCapability.d.ts +13 -0
- package/dist/models/ResolvedCapability.js +2 -0
- package/dist/models/ResolvedCapability.js.map +1 -0
- package/dist/models/ResolvedDevice.d.ts +42 -0
- package/dist/models/ResolvedDevice.js +2 -0
- package/dist/models/ResolvedDevice.js.map +1 -0
- package/dist/models/Room.d.ts +12 -0
- package/dist/models/Room.js +2 -0
- package/dist/models/Room.js.map +1 -0
- package/dist/models/StateConstraint.d.ts +42 -0
- package/dist/models/StateConstraint.js +2 -0
- package/dist/models/StateConstraint.js.map +1 -0
- package/dist/models/User.d.ts +1 -0
- package/dist/models/User.js +2 -0
- package/dist/models/User.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/Helpers.d.ts +1 -0
- package/dist/utils/Helpers.js +2 -0
- package/dist/utils/Helpers.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/websocket/DreoCommand.d.ts +13 -0
- package/dist/websocket/DreoCommand.js +2 -0
- package/dist/websocket/DreoCommand.js.map +1 -0
- package/dist/websocket/DreoWebSocketClient.d.ts +39 -0
- package/dist/websocket/DreoWebSocketClient.js +271 -0
- package/dist/websocket/DreoWebSocketClient.js.map +1 -0
- package/dist/websocket/DreoWebSocketMessage.d.ts +9 -0
- package/dist/websocket/DreoWebSocketMessage.js +2 -0
- package/dist/websocket/DreoWebSocketMessage.js.map +1 -0
- package/dist/websocket/DreoWebSocketReply.d.ts +7 -0
- package/dist/websocket/DreoWebSocketReply.js +2 -0
- package/dist/websocket/DreoWebSocketReply.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface HttpClientOptions {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
}
|
|
4
|
+
export interface RequestOptions {
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
query?: Record<string, string | number | boolean>;
|
|
7
|
+
body?: unknown;
|
|
8
|
+
}
|
|
9
|
+
export declare class HttpClient {
|
|
10
|
+
private readonly options;
|
|
11
|
+
constructor(options: HttpClientOptions);
|
|
12
|
+
get<TResponse>(path: string, options?: RequestOptions): Promise<TResponse>;
|
|
13
|
+
post<TResponse>(path: string, body?: unknown, options?: RequestOptions): Promise<TResponse>;
|
|
14
|
+
private request;
|
|
15
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export class HttpClient {
|
|
2
|
+
options;
|
|
3
|
+
constructor(options) {
|
|
4
|
+
this.options = options;
|
|
5
|
+
}
|
|
6
|
+
async get(path, options = {}) {
|
|
7
|
+
return this.request("GET", path, options);
|
|
8
|
+
}
|
|
9
|
+
async post(path, body, options = {}) {
|
|
10
|
+
return this.request("POST", path, {
|
|
11
|
+
...options,
|
|
12
|
+
body,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async request(method, path, options) {
|
|
16
|
+
const url = new URL(path, this.options.baseUrl);
|
|
17
|
+
url.searchParams.set("timestamp", Date.now().toString());
|
|
18
|
+
for (const [key, value] of Object.entries(options.query ?? {})) {
|
|
19
|
+
url.searchParams.set(key, String(value));
|
|
20
|
+
}
|
|
21
|
+
const response = await fetch(url, {
|
|
22
|
+
method,
|
|
23
|
+
headers: {
|
|
24
|
+
ua: "dreo/2.8.2",
|
|
25
|
+
lang: "en",
|
|
26
|
+
"content-type": "application/json; charset=UTF-8",
|
|
27
|
+
"accept-encoding": "gzip",
|
|
28
|
+
"user-agent": "okhttp/4.9.1",
|
|
29
|
+
...options.headers,
|
|
30
|
+
},
|
|
31
|
+
body: options.body === undefined
|
|
32
|
+
? undefined
|
|
33
|
+
: JSON.stringify(options.body),
|
|
34
|
+
});
|
|
35
|
+
if (!response.ok) {
|
|
36
|
+
throw new Error(`HTTP ${response.status} ${response.statusText}`);
|
|
37
|
+
}
|
|
38
|
+
return (await response.json());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=HttpClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/api/HttpClient.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,UAAU;IACiB;IAApC,YAAoC,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAE3D,KAAK,CAAC,GAAG,CACZ,IAAY,EACZ,UAA0B,EAAE;QAE5B,OAAO,IAAI,CAAC,OAAO,CAAY,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,IAAY,EACZ,IAAc,EACd,UAA0B,EAAE;QAE5B,OAAO,IAAI,CAAC,OAAO,CAAY,MAAM,EAAE,IAAI,EAAE;YACzC,GAAG,OAAO;YACV,IAAI;SACP,CAAC,CAAC;IACP,CAAC;IAEO,KAAK,CAAC,OAAO,CACjB,MAAc,EACd,IAAY,EACZ,OAAuB;QAEvB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAChD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEzD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;YAC7D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7C,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC9B,MAAM;YACN,OAAO,EAAE;gBACL,EAAE,EAAE,YAAY;gBAChB,IAAI,EAAE,IAAI;gBACV,cAAc,EAAE,iCAAiC;gBACjD,iBAAiB,EAAE,MAAM;gBACzB,YAAY,EAAE,cAAc;gBAC5B,GAAG,OAAO,CAAC,OAAO;aACrB;YACD,IAAI,EACA,OAAO,CAAC,IAAI,KAAK,SAAS;gBACtB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;SACzC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,QAAQ,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAc,CAAC;IAChD,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserApi.js","sourceRoot":"","sources":["../../src/api/UserApi.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DreoLogger } from "../DreoLogger.js";
|
|
2
|
+
import type { AuthTokens } from "../models/AuthTokens.js";
|
|
3
|
+
export interface LoginOptions {
|
|
4
|
+
email: string;
|
|
5
|
+
password: string;
|
|
6
|
+
region: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AuthManagerOptions {
|
|
9
|
+
logger?: DreoLogger;
|
|
10
|
+
}
|
|
11
|
+
export declare class AuthManager {
|
|
12
|
+
private readonly logger;
|
|
13
|
+
private readonly loginRequestBuilder;
|
|
14
|
+
constructor(options?: AuthManagerOptions);
|
|
15
|
+
login(options: LoginOptions): Promise<AuthTokens>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HttpClient } from "../api/HttpClient.js";
|
|
2
|
+
import { noopDreoLogger } from "../DreoLogger.js";
|
|
3
|
+
import { LoginRequestBuilder } from "./LoginRequestBuilder.js";
|
|
4
|
+
export class AuthManager {
|
|
5
|
+
logger;
|
|
6
|
+
loginRequestBuilder = new LoginRequestBuilder();
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
this.logger = options.logger ?? noopDreoLogger;
|
|
9
|
+
}
|
|
10
|
+
async login(options) {
|
|
11
|
+
const baseUrl = `https://app-api-${options.region}.dreo-tech.com`;
|
|
12
|
+
const http = new HttpClient({
|
|
13
|
+
baseUrl,
|
|
14
|
+
});
|
|
15
|
+
const body = this.loginRequestBuilder.build(options);
|
|
16
|
+
this.logger.info?.(`Logging in against region ${options.region}`);
|
|
17
|
+
const response = await http.post("/api/oauth/login", body);
|
|
18
|
+
if (response.code !== 0) {
|
|
19
|
+
throw new Error(`Dreo login failed: ${response.message ?? "Unknown error"}`);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
accessToken: response.data.access_token,
|
|
23
|
+
region: response.data.region,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=AuthManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthManager.js","sourceRoot":"","sources":["../../src/auth/AuthManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAY/D,MAAM,OAAO,WAAW;IACH,MAAM,CAAa;IAEnB,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IAEjE,YAAmB,UAA8B,EAAE;QAC/C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,OAAqB;QACpC,MAAM,OAAO,GAAG,mBAAmB,OAAO,CAAC,MAAM,gBAAgB,CAAC;QAElE,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC;YACxB,OAAO;SACV,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,6BAA6B,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAElE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAC5B,kBAAkB,EAClB,IAAI,CACP,CAAC;QAEF,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACX,sBAAsB,QAAQ,CAAC,OAAO,IAAI,eAAe,EAAE,CAC9D,CAAC;QACN,CAAC;QAED,OAAO;YACH,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY;YACvC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;SAC/B,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PasswordHasher } from "../crypto/PasswordHasher.js";
|
|
2
|
+
export class LoginRequestBuilder {
|
|
3
|
+
passwordHasher = new PasswordHasher();
|
|
4
|
+
build(options) {
|
|
5
|
+
return {
|
|
6
|
+
acceptLanguage: "en",
|
|
7
|
+
client_id: "7de37c362ee54dcf9c4561812309347a",
|
|
8
|
+
client_secret: "32dfa0764f25451d99f94e1693498791",
|
|
9
|
+
email: options.email,
|
|
10
|
+
encrypt: "ciphertext",
|
|
11
|
+
grant_type: "email-password",
|
|
12
|
+
himei: "faede31549d649f58864093158787ec9",
|
|
13
|
+
password: this.passwordHasher.hash(options.password),
|
|
14
|
+
scope: "all",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=LoginRequestBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginRequestBuilder.js","sourceRoot":"","sources":["../../src/auth/LoginRequestBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI7D,MAAM,OAAO,mBAAmB;IACX,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAEhD,KAAK,CAAC,OAAqB;QAC9B,OAAO;YACH,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,kCAAkC;YAC7C,aAAa,EAAE,kCAAkC;YACjD,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,OAAO,EAAE,YAAY;YACrB,UAAU,EAAE,gBAAgB;YAC5B,KAAK,EAAE,kCAAkC;YACzC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;YACpD,KAAK,EAAE,KAAK;SACf,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenStore.js","sourceRoot":"","sources":["../../src/auth/TokenStore.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordHasher.js","sourceRoot":"","sources":["../../src/crypto/PasswordHasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,OAAO,cAAc;IAChB,IAAI,CAAC,QAAgB;QACxB,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Signer.js","sourceRoot":"","sources":["../../src/crypto/Signer.ts"],"names":[],"mappings":""}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class DreoError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class DreoValidationError extends DreoError {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class DreoAuthenticationError extends DreoError {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class DreoWebSocketError extends DreoError {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class DreoError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = "DreoError";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class DreoValidationError extends DreoError {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "DreoValidationError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class DreoAuthenticationError extends DreoError {
|
|
14
|
+
constructor(message) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = "DreoAuthenticationError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class DreoWebSocketError extends DreoError {
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.name = "DreoWebSocketError";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAChC,YAAmB,OAAe;QAC9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC5B,CAAC;CACJ;AAED,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAC9C,YAAmB,OAAe;QAC9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACtC,CAAC;CACJ;AAED,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IAClD,YAAmB,OAAe;QAC9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IAC1C,CAAC;CACJ;AAED,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC7C,YAAmB,OAAe;QAC9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACrC,CAAC;CACJ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from "./DreoClient.js";
|
|
2
|
+
export * from "./DreoDevice.js";
|
|
3
|
+
export type { DreoLogger } from "./DreoLogger.js";
|
|
4
|
+
export { noopDreoLogger } from "./DreoLogger.js";
|
|
5
|
+
export * from "./errors.js";
|
|
6
|
+
export * from "./version.js";
|
|
7
|
+
export * from "./models/Device.js";
|
|
8
|
+
export * from "./models/DeviceCapabilities.js";
|
|
9
|
+
export * from "./models/DeviceStateResponse.js";
|
|
10
|
+
export * from "./models/DiscoveredState.js";
|
|
11
|
+
export * from "./models/DreoDeviceState.js";
|
|
12
|
+
export * from "./models/Family.js";
|
|
13
|
+
export * from "./models/FamilyTree.js";
|
|
14
|
+
export * from "./models/ResolvedCapability.js";
|
|
15
|
+
export * from "./models/ResolvedDevice.js";
|
|
16
|
+
export * from "./models/Room.js";
|
|
17
|
+
export * from "./models/StateConstraint.js";
|
|
18
|
+
export * from "./StateMapper.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from "./DreoClient.js";
|
|
2
|
+
export * from "./DreoDevice.js";
|
|
3
|
+
export { noopDreoLogger } from "./DreoLogger.js";
|
|
4
|
+
export * from "./errors.js";
|
|
5
|
+
export * from "./version.js";
|
|
6
|
+
export * from "./models/Device.js";
|
|
7
|
+
export * from "./models/DeviceCapabilities.js";
|
|
8
|
+
export * from "./models/DeviceStateResponse.js";
|
|
9
|
+
export * from "./models/DiscoveredState.js";
|
|
10
|
+
export * from "./models/DreoDeviceState.js";
|
|
11
|
+
export * from "./models/Family.js";
|
|
12
|
+
export * from "./models/FamilyTree.js";
|
|
13
|
+
export * from "./models/ResolvedCapability.js";
|
|
14
|
+
export * from "./models/ResolvedDevice.js";
|
|
15
|
+
export * from "./models/Room.js";
|
|
16
|
+
export * from "./models/StateConstraint.js";
|
|
17
|
+
export * from "./StateMapper.js";
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAE7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DeviceState } from "../models/DeviceState.js";
|
|
2
|
+
import type { DeviceStateResponse } from "../models/DeviceStateResponse.js";
|
|
3
|
+
export declare class DeviceStateMapper {
|
|
4
|
+
map(response: DeviceStateResponse): DeviceState;
|
|
5
|
+
private readBoolean;
|
|
6
|
+
private readOptionalBoolean;
|
|
7
|
+
private readNumber;
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class DeviceStateMapper {
|
|
2
|
+
map(response) {
|
|
3
|
+
const mixed = response.data.mixed;
|
|
4
|
+
return {
|
|
5
|
+
connected: this.readBoolean(mixed, "connected", false),
|
|
6
|
+
power: this.readBoolean(mixed, "poweron", false),
|
|
7
|
+
mode: this.readNumber(mixed, "mode", 0),
|
|
8
|
+
windLevel: this.readNumber(mixed, "windlevel", 0),
|
|
9
|
+
mute: this.readBoolean(mixed, "muteon", false),
|
|
10
|
+
childLock: this.readOptionalBoolean(mixed, "childlockon"),
|
|
11
|
+
light: this.readOptionalBoolean(mixed, "lighton"),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
readBoolean(mixed, key, fallback) {
|
|
15
|
+
const value = mixed[key]?.state;
|
|
16
|
+
return typeof value === "boolean" ? value : fallback;
|
|
17
|
+
}
|
|
18
|
+
readOptionalBoolean(mixed, key) {
|
|
19
|
+
const value = mixed[key]?.state;
|
|
20
|
+
return typeof value === "boolean" ? value : undefined;
|
|
21
|
+
}
|
|
22
|
+
readNumber(mixed, key, fallback) {
|
|
23
|
+
const value = mixed[key]?.state;
|
|
24
|
+
return typeof value === "number" ? value : fallback;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=DeviceStateMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceStateMapper.js","sourceRoot":"","sources":["../../src/mappers/DeviceStateMapper.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,iBAAiB;IACnB,GAAG,CAAC,QAA6B;QACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QAElC,OAAO;YACH,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC;YAEtD,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC;YAEhD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAEvC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;YAEjD,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC;YAE9C,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,aAAa,CAAC;YAEzD,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC;SACpD,CAAC;IACN,CAAC;IAEO,WAAW,CACf,KAAuB,EACvB,GAAW,EACX,QAAiB;QAEjB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;QAEhC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;IACzD,CAAC;IAEO,mBAAmB,CACvB,KAAuB,EACvB,GAAW;QAEX,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;QAEhC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1D,CAAC;IAEO,UAAU,CACd,KAAuB,EACvB,GAAW,EACX,QAAgB;QAEhB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;QAEhC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxD,CAAC;CACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FamilyTree } from "../models/FamilyTree.js";
|
|
2
|
+
import type { FamilyRoomDevicesResponse } from "../models/FamilyRoomDevicesResponse.js";
|
|
3
|
+
export declare class FamilyTreeMapper {
|
|
4
|
+
map(response: FamilyRoomDevicesResponse): FamilyTree;
|
|
5
|
+
private mapDevices;
|
|
6
|
+
private mapFamilies;
|
|
7
|
+
private mapRooms;
|
|
8
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class FamilyTreeMapper {
|
|
2
|
+
map(response) {
|
|
3
|
+
const devices = this.mapDevices(response);
|
|
4
|
+
const families = this.mapFamilies(response, devices);
|
|
5
|
+
return {
|
|
6
|
+
families,
|
|
7
|
+
devices,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
mapDevices(response) {
|
|
11
|
+
return response.data.list.map((device) => {
|
|
12
|
+
const apiDevice = device;
|
|
13
|
+
return {
|
|
14
|
+
deviceId: apiDevice.deviceId,
|
|
15
|
+
sn: apiDevice.sn,
|
|
16
|
+
deviceName: apiDevice.deviceName,
|
|
17
|
+
brand: apiDevice.brand,
|
|
18
|
+
model: apiDevice.model,
|
|
19
|
+
productId: apiDevice.productId,
|
|
20
|
+
productName: apiDevice.productName,
|
|
21
|
+
owner: apiDevice.owner,
|
|
22
|
+
shared: apiDevice.shared,
|
|
23
|
+
resourcesConf: apiDevice.resourcesConf,
|
|
24
|
+
capabilities: {
|
|
25
|
+
controlsConf: apiDevice.controlsConf,
|
|
26
|
+
control: apiDevice.control,
|
|
27
|
+
schedule: apiDevice.schedule,
|
|
28
|
+
mainConf: apiDevice.mainConf,
|
|
29
|
+
servicesConf: apiDevice.servicesConf,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
mapFamilies(response, devices) {
|
|
35
|
+
return response.data.familyRooms.map((family) => ({
|
|
36
|
+
...family,
|
|
37
|
+
rooms: this.mapRooms(family.rooms, devices),
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
mapRooms(rooms, devices) {
|
|
41
|
+
return rooms.map((room) => ({
|
|
42
|
+
...room,
|
|
43
|
+
devices: room.devices.map((roomDevice) => {
|
|
44
|
+
const fullDevice = devices.find((device) => device.deviceId === roomDevice.deviceId);
|
|
45
|
+
return fullDevice ?? roomDevice;
|
|
46
|
+
}),
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=FamilyTreeMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FamilyTreeMapper.js","sourceRoot":"","sources":["../../src/mappers/FamilyTreeMapper.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,gBAAgB;IAClB,GAAG,CAAC,QAAmC;QAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAErD,OAAO;YACH,QAAQ;YACR,OAAO;SACV,CAAC;IACN,CAAC;IAEO,UAAU,CAAC,QAAmC;QAClD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACrC,MAAM,SAAS,GAAG,MAA0B,CAAC;YAE7C,OAAO;gBACH,QAAQ,EAAE,SAAS,CAAC,QAAQ;gBAC5B,EAAE,EAAE,SAAS,CAAC,EAAE;gBAChB,UAAU,EAAE,SAAS,CAAC,UAAU;gBAChC,KAAK,EAAE,SAAS,CAAC,KAAK;gBACtB,KAAK,EAAE,SAAS,CAAC,KAAK;gBACtB,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,KAAK,EAAE,SAAS,CAAC,KAAK;gBACtB,MAAM,EAAE,SAAS,CAAC,MAAM;gBACxB,aAAa,EAAE,SAAS,CAAC,aAAa;gBACtC,YAAY,EAAE;oBACV,YAAY,EAAE,SAAS,CAAC,YAAY;oBACpC,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,QAAQ,EAAE,SAAS,CAAC,QAAQ;oBAC5B,QAAQ,EAAE,SAAS,CAAC,QAAQ;oBAC5B,YAAY,EAAE,SAAS,CAAC,YAAY;iBACvC;aACJ,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,WAAW,CACf,QAAmC,EACnC,OAAiB;QAEjB,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC9C,GAAG,MAAM;YACT,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;SAC9C,CAAC,CAAC,CAAC;IACR,CAAC;IAEO,QAAQ,CAAC,KAAa,EAAE,OAAiB;QAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACxB,GAAG,IAAI;YACP,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;gBACrC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAC3B,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,UAAU,CAAC,QAAQ,CACtD,CAAC;gBAEF,OAAO,UAAU,IAAI,UAAU,CAAC;YACpC,CAAC,CAAC;SACL,CAAC,CAAC,CAAC;IACR,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthTokens.js","sourceRoot":"","sources":["../../src/models/AuthTokens.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Commands.js","sourceRoot":"","sources":["../../src/models/Commands.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeviceCapabilities } from "./DeviceCapabilities.js";
|
|
2
|
+
export interface Device {
|
|
3
|
+
deviceId: string;
|
|
4
|
+
sn: string;
|
|
5
|
+
deviceName: string;
|
|
6
|
+
brand: string;
|
|
7
|
+
model: string;
|
|
8
|
+
productId: string;
|
|
9
|
+
productName: string;
|
|
10
|
+
owner: boolean;
|
|
11
|
+
shared: boolean;
|
|
12
|
+
resourcesConf?: {
|
|
13
|
+
imageSmallSrc?: string | null;
|
|
14
|
+
imageFullSrc?: string | null;
|
|
15
|
+
imageSmallDarkSrc?: string | null;
|
|
16
|
+
imageFullDarkSrc?: string | null;
|
|
17
|
+
};
|
|
18
|
+
capabilities?: DeviceCapabilities;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Device.js","sourceRoot":"","sources":["../../src/models/Device.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceCapabilities.js","sourceRoot":"","sources":["../../src/models/DeviceCapabilities.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceListResponse.js","sourceRoot":"","sources":["../../src/models/DeviceListResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceState.js","sourceRoot":"","sources":["../../src/models/DeviceState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DeviceStateValue<TValue = unknown> {
|
|
2
|
+
state: TValue;
|
|
3
|
+
timestamp: number | null;
|
|
4
|
+
}
|
|
5
|
+
export interface DeviceTimerValue {
|
|
6
|
+
du: number;
|
|
7
|
+
ts: number;
|
|
8
|
+
}
|
|
9
|
+
export type DeviceMixedState = Record<string, DeviceStateValue>;
|
|
10
|
+
export interface DeviceStateResponse {
|
|
11
|
+
code: number;
|
|
12
|
+
msg: string;
|
|
13
|
+
data: {
|
|
14
|
+
mixed: DeviceMixedState;
|
|
15
|
+
sn: string;
|
|
16
|
+
productId: string;
|
|
17
|
+
region: string;
|
|
18
|
+
deviceInfo: unknown | null;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceStateResponse.js","sourceRoot":"","sources":["../../src/models/DeviceStateResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceSummary.js","sourceRoot":"","sources":["../../src/models/DeviceSummary.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StateConstraint } from "./StateConstraint.js";
|
|
2
|
+
export type DiscoveredStateType = "boolean" | "number" | "string" | "object" | "unknown";
|
|
3
|
+
export type DiscoveredStateCategory = "control" | "sensor" | "diagnostic" | "configuration" | "information" | "unknown";
|
|
4
|
+
export interface DiscoveredState {
|
|
5
|
+
key: string;
|
|
6
|
+
valueType: DiscoveredStateType;
|
|
7
|
+
writable: boolean;
|
|
8
|
+
category: DiscoveredStateCategory;
|
|
9
|
+
description: string;
|
|
10
|
+
known: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Optional value constraint for safe adapter and SDK usage.
|
|
13
|
+
*
|
|
14
|
+
* This can describe numeric ranges, enum-like allowed values,
|
|
15
|
+
* boolean states, string values, object values, or unknown constraints.
|
|
16
|
+
*/
|
|
17
|
+
constraint?: StateConstraint;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscoveredState.js","sourceRoot":"","sources":["../../src/models/DiscoveredState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface DreoDeviceState {
|
|
2
|
+
power?: boolean;
|
|
3
|
+
fan?: boolean;
|
|
4
|
+
mainLight?: boolean;
|
|
5
|
+
atmosphereLight?: boolean;
|
|
6
|
+
mute?: boolean;
|
|
7
|
+
windLevel?: number;
|
|
8
|
+
mode?: number;
|
|
9
|
+
brightness?: number;
|
|
10
|
+
colorTemperature?: number;
|
|
11
|
+
rgbPreset?: number;
|
|
12
|
+
rgbEffectId?: string;
|
|
13
|
+
rssi?: unknown;
|
|
14
|
+
raw: Record<string, unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DreoDeviceState.js","sourceRoot":"","sources":["../../src/models/DreoDeviceState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Room } from "./Room.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a Dreo family/home visible to the authenticated account.
|
|
4
|
+
*/
|
|
5
|
+
export interface Family {
|
|
6
|
+
familyId: string;
|
|
7
|
+
familyName: string;
|
|
8
|
+
owner: boolean;
|
|
9
|
+
userId: string | null;
|
|
10
|
+
userName: string | null;
|
|
11
|
+
avatarType: string;
|
|
12
|
+
avatarValue: string;
|
|
13
|
+
rooms: Room[];
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Family.js","sourceRoot":"","sources":["../../src/models/Family.ts"],"names":[],"mappings":""}
|