Skip to content

Commit

Permalink
Release 3.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Feb 27, 2021
1 parent c554420 commit 932cabd
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,8 @@
},
"3.0.17": {
"en": "Please see the support forum for the change log. The release contains too much (breaking) changes to be added in the changelog here."
},
"3.0.18": {
"en": "Please see the support forum for the change log. The release contains too much (breaking) changes to be added in the changelog here."
}
}
9 changes: 6 additions & 3 deletions .homeycompose/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"Shelly Vintage",
"Shelly i3",
"Shelly Gas",
"Shelly Button"
"Shelly Button",
"Shelly Motion"
],
"nl": [
"Shelly",
Expand All @@ -47,10 +48,12 @@
"Shelly Vintage",
"Shelly i3",
"Shelly Gas",
"Shelly Button"
"Shelly Button",
"Shelly bewegingssenor",
"Shelly motion"
]
},
"version": "3.0.17",
"version": "3.0.18",
"compatibility": ">=5.0.0",
"author": {
"name": "Jelger Haanstra",
Expand Down
9 changes: 6 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"Shelly Vintage",
"Shelly i3",
"Shelly Gas",
"Shelly Button"
"Shelly Button",
"Shelly Motion"
],
"nl": [
"Shelly",
Expand All @@ -48,10 +49,12 @@
"Shelly Vintage",
"Shelly i3",
"Shelly Gas",
"Shelly Button"
"Shelly Button",
"Shelly bewegingssenor",
"Shelly motion"
]
},
"version": "3.0.17",
"version": "3.0.18",
"compatibility": ">=5.0.0",
"author": {
"name": "Jelger Haanstra",
Expand Down
6 changes: 3 additions & 3 deletions drivers/shelly3em/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Shelly3EmDevice extends Homey.Device {
if (!this.getAvailable()) { this.setAvailable(); }

let channel = this.getStoreValue('channel');
let measure_power = result.meters[channel].power;
let measure_power = result.emeters[channel].power;
let meter_power_factor = result.emeters[channel].pf;
let measure_current = result.emeters[channel].current;
let measure_voltage = result.emeters[channel].voltage;
Expand Down Expand Up @@ -121,10 +121,10 @@ class Shelly3EmDevice extends Homey.Device {
this.setCapabilityValue('meter_power_returned', meter_power_returned_rounded);
}

// update measure_power and meter_power only for channel 0
// update onoff only for channel 0
if (this.getStoreValue('channel') === 0) {
// capability onoff
let onoff = this.getStoreValue("channel") === 0 ? result.relays[0].ison : result.relays[1].ison;
let onoff = result.relays[0].ison;
if (onoff != this.getCapabilityValue('onoff')) {
this.setCapabilityValue('onoff', onoff);
}
Expand Down
8 changes: 7 additions & 1 deletion drivers/shellymotion/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ class ShellyMotionDriver extends Homey.Driver {
});

session.setHandler('add_device', async (data) => {
return Promise.resolve(deviceArray);
try {
const homey_ip = await this.homey.cloud.getLocalAddress();
const result = await this.util.sendCommand('/settings?coiot_enable=true&coiot_peer='+ homey_ip.substring(0, homey_ip.length-3), deviceArray.settings.address, deviceArray.settings.username, deviceArray.settings.password);
return Promise.resolve(deviceArray);
} catch (error) {
return Promise.reject(error);
}
});

session.setHandler('save_icon', async (data) => {
Expand Down
2 changes: 1 addition & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"success": "Shelly device added succesfully",
"startpairing": "First pair the device with the Shelly smartphone app. Then press the physical button on your Shelly sensor or remove and re-insert the battery to wake up the device. The LED inside the sensor stops blinking once it has connected to your WiFi and is then ready for pairing. Then you can click the next button below.",
"startpairingbutton": "First pair the device with the Shelly smartphone app. Connect a USB cable to the button to ensure it's powered and connected with your WiFi before continuing.",
"startpairingmotion": "[DUE TO A BUG IN THE MOTION SENSOR FIRMWARE YOU NEED TO MANUALLY PAIR THIS DEVICE USING ITS IP ADDRESS AS IT WONT BE DISCOVERED] First pair the device with the Shelly smartphone app. Enable the CoAP communication (under Internet & Security) through the webinterface of your Shelly Motion Sensor and enter the IP address of Homey here. From the webinterface reboot your Shelly Motion and continu this pairing wizard directly after the sensor has rebooted.",
"startpairingmotion": "[DUE TO A BUG IN THE MOTION SENSOR FIRMWARE YOU NEED TO MANUALLY PAIR THIS DEVICE USING ITS IP ADDRESS] First pair the device with the Shelly smartphone app. From the webinterface reboot your Shelly Motion Sensor and continu this pairing wizard directly after the sensor has rebooted.",
"titleselection": "What do you want to do?",
"nodevices": "No devices have been discovered. You can try again or use manual pairing if you know the IP address of your Shelly device.",
"again": "Try Again",
Expand Down
2 changes: 1 addition & 1 deletion locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"success": "Shelly apparaat succesvol toegevoegd",
"startpairing": "Koppel het apparaat eerst met de Shelly smartphone app. Druk daarna op de fysieke knop op in je Shelly sensor of verwijder en herplaats de batterij om het apparaat wakker te maken. Wacht tot de LED aan blijft, de Shelly is dan verbonden met je WiFi netwerk. Klik vervolgens op de volgende knop hieronder.",
"startpairingbutton": "Koppel het apparaat eerst met de Shelly smartphone app. Verbind een USB kabel aan de knop om er zeker van te zijn dat deze stroom heeft en verbonden is met WiFi voordat je verder gaat.",
"startpairingmotion": "[DUE TO A BUG IN THE MOTION SENSOR FIRMWARE YOU NEED TO MANUALLY PAIR THIS DEVICE USING ITS IP ADDRESS AS IT WONT BE DISCOVERED] Koppel het apparaat eerst met de Shelly smartphone app. Schakel de CoAP communicatie optie (onder Internet & Security) in via de webinterface van de Shelly en voeg hier het IP adres van Homey toe. Herstart je Shelly via de webinterface en ga verder met de pairing wizard direct nadat de sensor is herstart.",
"startpairingmotion": "[DUE TO A BUG IN THE MOTION SENSOR FIRMWARE YOU NEED TO MANUALLY PAIR THIS DEVICE USING ITS IP ADDRESS] Koppel het apparaat eerst met de Shelly smartphone app. Herstart je Shelly bewegingssensor via de webinterface en ga verder met de pairing wizard direct nadat de sensor is herstart.",
"titleselection": "Wat wil je doen?",
"nodevices": "Geen apparaten gevonden. Je kan het nog een keer proberen of je Shelly handmatig toevoegen als je het IP adres weet.",
"again": "Probeer opnieuw",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloud.shelly",
"version": "3.0.17",
"version": "3.0.18",
"description": "Homey app for controlling Shelly devices",
"main": "app.js",
"scripts": {
Expand Down

0 comments on commit 932cabd

Please sign in to comment.