Skip to content

Commit

Permalink
feat: fix config.schema.json and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
kakopappa committed Dec 10, 2023
1 parent d94fec2 commit 8b4b5c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
12 changes: 0 additions & 12 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
"title": "API key",
"type": "string",
"required": true
},
"enabledTypes": {
"title": "Enabled devices",
"type": "array",
"uniqueItems": true,
"items": {
"title": "Type",
"type": "string",
"enum": [
"Switch"
]
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class SinricProApiClient {
this.axiosClient.get('/devices'),
]);

this.log.debug(`${initData[0].data.devices.length} device(s) found!`);
this.log.debug(`[getDevices()]: ${initData[0].data.devices.length} device(s) found!`);

for (const device of initData[0].data.devices) {
const sinricproDevice: SinricProDevice = {
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

export const SINRICPRO_HOMEBRIDGE_CLIENT_ID = 'api_interaction';
export const SINRICPRO_API_ENDPOINT_BASE_URL = 'https://api.sinric.pro/api/v1';
export const SINRICPRO_SSE_ENDPOINT_BASE_URL = 'https://sse.sinric.pro/sse/stream?accessToken=%s';
export const SINRICPRO_SSE_ENDPOINT_BASE_URL = 'https://portal.sinric.pro/sse/stream?accessToken=%s';

export abstract class ModelConstants {
static readonly MANUFACTURER = 'SinricPro';
Expand Down
20 changes: 10 additions & 10 deletions src/model/sinricpro-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export interface SinricProDevice {
id: number;
name: string;
deviceType: SinricProDeviceType;
powerState: string | undefined; // On or Off
rangeValue: number | undefined;
garageDoorState: number | undefined;
brightness: number | undefined;
powerLevel: number | undefined;
temperature: number | undefined;
thermostatMode: string | undefined;
contactState: string | undefined;
humidity: number | undefined;
lastMotionState: string | undefined;
powerState?: string;
rangeValue?: number;
garageDoorState?: number;
brightness?: number;
powerLevel?: number;
temperature?: number;
thermostatMode?: string;
contactState?: string;
humidity?: number;
lastMotionState?: string;
}

0 comments on commit 8b4b5c2

Please sign in to comment.