Skip to content

Commit

Permalink
Use default CLIENT_ID when clientID is not set in config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuoza committed Nov 6, 2021
1 parent 7f8bda4 commit cfd3383
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
17 changes: 1 addition & 16 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@
"type": "password"
}
},
"clientID": {
"title": "Client ID",
"description": "CLIENT_ID at https://dash.candyhouse.co. Leave blank when you don't have CLIENT_ID.",
"type": "string",
"required": false
},
"interval": {
"title": "Status update interval(second)",
"description": "Status update interval used only when CLIENT_ID is empty",
"type": "number",
"default": 3600000,
"required": false
},
"locks": {
"title": "Sesame Locks",
"type": "array",
Expand Down Expand Up @@ -94,9 +81,7 @@
"title": "Common settings",
"items": [
"name",
"apiKey",
"clientID",
"interval"
"apiKey"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
} from "./settings";
import { CHDevice } from "./types/Device";

const CLIENT_ID = "ap-northeast-1:0a1820f1-dbb3-4bca-9227-2a92f6abf0ae";

export class OpenSesame implements DynamicPlatformPlugin {
public readonly Service: typeof Service = this.api.hap.Service;
public readonly Characteristic: typeof Characteristic =
Expand Down Expand Up @@ -49,6 +51,7 @@ export class OpenSesame implements DynamicPlatformPlugin {
}

this.config = config;
this.config.clientID = config.clientID ? config.clientID : CLIENT_ID;

this.api.on(APIEvent.DID_FINISH_LAUNCHING, () => {
this.log.debug("Executed didFinishLaunching callback");
Expand Down

0 comments on commit cfd3383

Please sign in to comment.