Skip to content

Commit

Permalink
1.1.5 added lan mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxmudjon committed Nov 30, 2020
1 parent dc26610 commit 3d5e2dd
Show file tree
Hide file tree
Showing 3,495 changed files with 124,843 additions and 117,247 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 6 additions & 5 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ module.exports = [
path: "/getDevices",
fn: async (args, callback) => {
await Homey.app
.getDevices(args)
.then(res => {
.sign(args)
.then((res) => {
console.log("res api", res);
callback(null, res);
})
.catch(error => {
.catch((error) => {
callback(error, null);
});
}
}
},
},
];
6 changes: 5 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ class Ewelink extends Homey.App {
onSettingsChanged(key) {
switch (key) {
case "account":
this.ewelinkApi.destroy();
this.ewelinkApi.eWeLinkShutdown();
this.ewelinkApi.connect();
break;
default:
break;
}
}

sign(signData) {
return Homey.app.ewelinkApi.sign(signData);
}

getDevices(signData) {
return Homey.app.ewelinkApi.getAllDevices(signData);
}
Expand Down
240 changes: 238 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "com.maxmudjon.ewelink",
"version": "1.0.7",
"version": "1.1.5",
"compatibility": ">=2.2.0",
"sdk": 2,
"name": {
Expand Down Expand Up @@ -2262,7 +2262,7 @@
{
"id": "sonoff-s20",
"name": {
"en": "Sonoff S20"
"en": "Sonoff S20 / S26 (R1)"
},
"class": "socket",
"capabilities": ["onoff"],
Expand Down Expand Up @@ -2630,9 +2630,245 @@
]
}
]
},
{
"id": "zigbee_temperature_humidity_sensor",
"name": {
"en": "Temperature Humidity sensor"
},
"class": "socket",
"capabilities": ["measure_temperature", "measure_humidity", "measure_battery", "alarm_battery"],
"images": {
"large": "/drivers/zigbee_temperature_humidity_sensor/assets/images/large.png",
"small": "/drivers/zigbee_temperature_humidity_sensor/assets/images/small.png"
},
"energy": {
"batteries": ["CR2450"]
},
"pair": [
{
"id": "list_devices",
"template": "list_devices",
"navigation": {
"next": "add_devices"
},
"options": {
"singular": false
}
},
{
"id": "add_devices",
"template": "add_devices"
}
],
"settings": [
{
"type": "group",
"label": {
"en": "Device information"
},
"children": [
{
"id": "brandName",
"type": "label",
"label": {
"en": "Brand name"
},
"value": "brand_name"
},
{
"id": "model",
"type": "label",
"label": {
"en": "Model"
},
"value": "model_name"
},
{
"id": "ip",
"type": "label",
"label": {
"en": "IP"
},
"value": "ip_address"
}
]
}
]
},
{
"id": "zigbee_switch",
"name": {
"en": "Switch"
},
"class": "socket",
"capabilities": ["measure_battery", "alarm_battery"],
"images": {
"large": "/drivers/zigbee_switch/assets/images/large.png",
"small": "/drivers/zigbee_switch/assets/images/small.png"
},
"energy": {
"batteries": ["CR2450"]
},
"pair": [
{
"id": "list_devices",
"template": "list_devices",
"navigation": {
"next": "add_devices"
},
"options": {
"singular": false
}
},
{
"id": "add_devices",
"template": "add_devices"
}
],
"settings": [
{
"type": "group",
"label": {
"en": "Device information"
},
"children": [
{
"id": "brandName",
"type": "label",
"label": {
"en": "Brand name"
},
"value": "brand_name"
},
{
"id": "model",
"type": "label",
"label": {
"en": "Model"
},
"value": "model_name"
},
{
"id": "ip",
"type": "label",
"label": {
"en": "IP"
},
"value": "ip_address"
}
]
}
]
},
{
"id": "zigbee_motion_sensor",
"name": {
"en": "Motion sensor"
},
"class": "socket",
"capabilities": ["alarm_motion", "measure_battery", "alarm_battery"],
"images": {
"large": "/drivers/zigbee_motion_sensor/assets/images/large.png",
"small": "/drivers/zigbee_motion_sensor/assets/images/small.png"
},
"energy": {
"batteries": ["CR2450"]
},
"pair": [
{
"id": "list_devices",
"template": "list_devices",
"navigation": {
"next": "add_devices"
},
"options": {
"singular": false
}
},
{
"id": "add_devices",
"template": "add_devices"
}
],
"settings": [
{
"type": "group",
"label": {
"en": "Device information"
},
"children": [
{
"id": "brandName",
"type": "label",
"label": {
"en": "Brand name"
},
"value": "brand_name"
},
{
"id": "model",
"type": "label",
"label": {
"en": "Model"
},
"value": "model_name"
},
{
"id": "ip",
"type": "label",
"label": {
"en": "IP"
},
"value": "ip_address"
}
]
}
]
}
],
"flow": {
"triggers": [
{
"id": "click_switch",
"title": {
"en": "Single click switch"
},
"args": [
{
"name": "device",
"type": "device",
"filter": "driver_id=zigbee_switch"
}
]
},
{
"id": "double_click_switch",
"title": {
"en": "Double click switch"
},
"args": [
{
"name": "device",
"type": "device",
"filter": "driver_id=zigbee_switch"
}
]
},
{
"id": "long_press_switch",
"title": {
"en": "Long press switch"
},
"args": [
{
"name": "device",
"type": "device",
"filter": "driver_id=zigbee_switch"
}
]
}
],
"actions": [
{
"id": "secondChannelOn",
Expand Down
Binary file added com.maxmudjon.ewelink.zip
Binary file not shown.
Loading

0 comments on commit 3d5e2dd

Please sign in to comment.