Skip to content

Commit 5acd130

Browse files
committed
Complete rewrite in TypeScript and homebridge plugin 2.0 API
1 parent 00dc6ac commit 5acd130

21 files changed

+1421
-20
lines changed

.gitignore

100644100755
File mode changed.

LICENSE

100644100755
File mode changed.

README.md

100644100755
+7-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ The plugin is published through [NPM](https://www.npmjs.com/package/homebridge-b
99
npm install -g homebridge-blynk
1010

1111
# Release notes
12+
Version 0.9.0
13+
+ Complete rewriting in typescrypt and homebridge plugin 2.0 API
14+
+ Based on Blynk REST API
15+
+ Works on both cloud server and local server: for cloud server the Blynk App must be running in order to receive automatic update of the pin values (setting pins works also without the app runing); for local server put "allow.reading.widget.without.active.app=true" in server.properties in order to be able to receive automatic update of the pin values.
16+
1217
Version 0.3.0
1318
+ Cleanup and fixes
1419

@@ -54,11 +59,11 @@ assuming a switch within the dashboard specify in the accessories parameter of t
5459
where:
5560

5661
`name` will be the accessory name from the HomeKit point of view
57-
`widget` must be "Switch"
62+
`widget` must be one of: "Switch", "TemperatureSensor", "HumiditySensor", "MotionSensor", "SmokeSensor", "LightSensor"
5863
`mode` can be "SWITCH" or "PUSH"
5964
`caption` will be the name you should refer to from Siri
6065
`pin` is the pin to actuate
61-
+ Use an HomeKit app to add the accessory to the iPhone/iPad, e.g.: MyHome
66+
+ Use the Home app to add the accessory to the iPhone/iPad
6267

6368
After that you can say to Siri:
6469

blynk_sample_commands.txt

100644100755
File mode changed.

config.json

100644100755
+9-10
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,27 @@
1212
{
1313
"platform": "Blynk",
1414
"name": "Blynk",
15-
"server": "PUT THE ADDRESS OF THE LOCAL BLYNK SERVER HERE",
16-
"httpsPort": "PUT THE PORT OF THE LOCAL BLYNK SERVER HERE, TIPICALLY 9443",
17-
"token" : "Your project token",
18-
"dashboardName": "PUT THE DASHBOARD NAME HERE",
15+
"serverurl": "PUT THE URL OF THE BLYNK SERVER HERE, e.g.: http://10.0.0.102:8080",
16+
"token" : "PUT YOUR PROJECT AUTHORIZATION TOKEN HERE",
17+
"pollerperiod": "PUT 0 FOR DISABLING POLLING, 1 - 100 INTERVAL IN SECONDS. 1 SECONDS IS THE DEFAULT",
1918
"accessories": [
2019
{
21-
"name": "SwitchD5",
20+
"name": "Switch1",
2221
"widget": "Switch",
2322
"mode": "SWITCH",
24-
"caption": "Lamp 1",
25-
"pin": "D5"
23+
"caption": "Main Lamp",
24+
"pin": "D3"
2625
},
2726
{
2827
"name": "ContactSensor1",
2928
"widget": "ContactSensor",
30-
"caption": "Door 1",
31-
"pin": "D4"
29+
"caption": "Main Door",
30+
"pin": "D2"
3231
},
3332
{
3433
"name": "TemperatureSensor1",
3534
"widget": "TemperatureSensor",
36-
"caption": "Temperature 1",
35+
"caption": "Kitchen Temperature",
3736
"pin": "A17"
3837
}
3938
]

dist/blynkaccessory.d.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export declare const pluginName = "homebridge-blynk";
2+
export declare const platformName = "Blynk";
3+
export declare class BlynkService {
4+
controlService: any;
5+
characteristics: any[];
6+
constructor(controlService: any, characteristics: any[]);
7+
}
8+
export declare class BlynkAccessory {
9+
name: string;
10+
services: BlynkService[];
11+
accessory: any;
12+
hapAccessory: any;
13+
hapService: any;
14+
hapCharacteristic: any;
15+
platform: any;
16+
constructor(device: any, services: BlynkService[], hapAccessory: any, hapService: any, hapCharacteristic: any, platform: any);
17+
initAccessory(): void;
18+
removeNoMoreExistingServices(): void;
19+
addNewServices(platform: any): void;
20+
registerUpdateAccessory(isNewAccessory: any, api: any): void;
21+
setAccessory(accessory: any): void;
22+
static createBlynkAccessory(device: any, hapAccessory: any, hapService: any, hapCharacteristic: any, platform: any): BlynkAccessory | undefined;
23+
}

dist/blynkaccessory.js

+131
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/blynkaccessory.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const _default: (homebridge: any) => void;
2+
export = _default;

0 commit comments

Comments
 (0)