Skip to content

Commit

Permalink
Release 1.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Jun 22, 2020
1 parent 50032b7 commit 45da977
Show file tree
Hide file tree
Showing 21 changed files with 16 additions and 117 deletions.
3 changes: 3 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,8 @@
},
"1.22.3": {
"en": "Add support for Shelly Dimmer 2"
},
"1.23.0": {
"en": "Added device ID to callback trigger card and removed the old button events card which was deprecated since the last couple of app versions."
}
}
7 changes: 2 additions & 5 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ module.exports = [
device.setCapabilityValue('alarm_water', false);
}

// TODO: DEPRECATED, WILL BE REMOVED IN NEXT MAJOR RELEASE
device.triggerCallbackEvents(args.params.action);

let callbackTrigger = new Homey.FlowCardTrigger('triggerCallbacks');
callbackTrigger.register().trigger({"device": device.getName(), "action": args.params.action});
callbackTrigger.register().trigger({"id": args.params.deviceid, "device": device.getName(), "action": args.params.action});

callback(false, 'OK');
})().catch(err => {
Expand All @@ -44,7 +41,7 @@ module.exports = [
public : true,
fn: function(args, callback) {
(async () => {
console.log(args);
console.log(args); // leave this in for sending debug reports
let device = await Homey.ManagerDrivers.getDriver(args.params.devicetype).getDevice({'id': args.params.deviceid});
await device.updateReportStatus(device, args.query);
callback(false, 'OK');
Expand Down
39 changes: 9 additions & 30 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"Shelly i3"
]
},
"version": "1.22.3",
"version": "1.23.0",
"compatibility": ">=3.0.0",
"author": {
"name": "Jelger Haanstra",
Expand Down Expand Up @@ -3776,48 +3776,27 @@
]
},
{
"id": "triggerCallbackEvents",
"deprecated": true,
"id": "triggerCallbacks",
"title": {
"en": "Action event",
"nl": "Actie gebeurtenis"
},
"tokens": [
{
"name": "action",
"name": "id",
"type": "string",
"title": {
"en": "Action",
"nl": "Actie"
},
"example": "longpush"
}
],
"args": [
{
"name": "device",
"type": "device",
"placeholder": {
"en": "Select Shelly",
"nl": "Selecteer Shelly"
"en": "Device ID",
"nl": "Apparaat ID"
},
"filter": "driver_id=shelly1|shelly1pm|shellydimmer|shelly2|shelly25|shelly-plug|shelly-plug-s|shellyem|shelly3em|shellydw|shellyduo|shellyflood|shellyi3&capabilities=button.callbackevents"
}
]
},
{
"id": "triggerCallbacks",
"title": {
"en": "Action event",
"nl": "Actie gebeurtenis"
},
"tokens": [
"example": "shelly1-8D4C25"
},
{
"name": "device",
"type": "string",
"title": {
"en": "Device",
"nl": "Apparaat"
"en": "Name",
"nl": "Naam"
},
"example": "Shelly 1"
},
Expand Down
6 changes: 0 additions & 6 deletions drivers/shelly-plug-s/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class ShellyPlugSDevice extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();

Expand Down Expand Up @@ -145,10 +143,6 @@ class ShellyPlugSDevice extends Homey.Device {
}, 63000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = ShellyPlugSDevice;
6 changes: 0 additions & 6 deletions drivers/shelly-plug/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class ShellyPlugDevice extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();

Expand Down Expand Up @@ -137,10 +135,6 @@ class ShellyPlugDevice extends Homey.Device {
}, 63000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = ShellyPlugDevice;
5 changes: 0 additions & 5 deletions drivers/shelly1/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class Shelly1Device extends Homey.Device {
onInit() {
new Homey.FlowCardTriggerDevice('triggerShelly1Temperature2').register();
new Homey.FlowCardTriggerDevice('triggerShelly1Temperature3').register();
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();
Expand Down Expand Up @@ -166,10 +165,6 @@ class Shelly1Device extends Homey.Device {
}, 63000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {});
}

}

module.exports = Shelly1Device;
1 change: 0 additions & 1 deletion drivers/shelly1/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Shelly1Driver extends Homey.Driver {
let deviceArray = {};

socket.on('list_devices', (data, callback) => {
this.log(discoveryResults);
const devices = Object.values(discoveryResults).map(discoveryResult => {
return {
name: 'Shelly1 ['+ discoveryResult.address +']',
Expand Down
5 changes: 0 additions & 5 deletions drivers/shelly1pm/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Shelly1pmDevice extends Homey.Device {
new Homey.FlowCardTriggerDevice('triggerShelly1Temperature1').register();
new Homey.FlowCardTriggerDevice('triggerShelly1Temperature2').register();
new Homey.FlowCardTriggerDevice('triggerShelly1Temperature3').register();
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();
Expand Down Expand Up @@ -197,10 +196,6 @@ class Shelly1pmDevice extends Homey.Device {
}, 63000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = Shelly1pmDevice;
6 changes: 0 additions & 6 deletions drivers/shelly2/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class Shelly2Device extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.setAvailable();

// ADD MISSING CAPABILITIES
Expand Down Expand Up @@ -78,10 +76,6 @@ class Shelly2Device extends Homey.Device {
return Homey.ManagerDrivers.getDriver('shelly2').loadDevices();
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = Shelly2Device;
5 changes: 0 additions & 5 deletions drivers/shelly25/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class Shelly25Device extends Homey.Device {
onInit() {
new Homey.FlowCardTriggerDevice('triggerMeterPowerFactor').register();
new Homey.FlowCardTriggerDevice('triggerMeterPowerWmin').register();
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.setAvailable();

Expand Down Expand Up @@ -80,10 +79,6 @@ class Shelly25Device extends Homey.Device {
return Homey.ManagerDrivers.getDriver('shelly25').loadDevices();
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = Shelly25Device;
5 changes: 0 additions & 5 deletions drivers/shelly3em/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Shelly3EmDevice extends Homey.Device {
new Homey.FlowCardTriggerDevice('triggerMeterPowerConsumed').register();
new Homey.FlowCardTriggerDevice('triggerMeterPowerReturned').register();
new Homey.FlowCardTriggerDevice('triggerMeterPowerFactor').register();
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.setAvailable();

Expand Down Expand Up @@ -65,10 +64,6 @@ class Shelly3EmDevice extends Homey.Device {
return Homey.ManagerDrivers.getDriver('shelly3em').loadDevices();
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = Shelly3EmDevice;
5 changes: 0 additions & 5 deletions drivers/shellydimmer/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class ShellyDimmerDevice extends Homey.Device {
onInit() {
new Homey.FlowCardTriggerDevice('triggerDimmerInput1').register();
new Homey.FlowCardTriggerDevice('triggerDimmerInput2').register();
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();
Expand Down Expand Up @@ -213,10 +212,6 @@ class ShellyDimmerDevice extends Homey.Device {
}, 63000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = ShellyDimmerDevice;
6 changes: 0 additions & 6 deletions drivers/shellyduo/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class ShellyDuoDevice extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();

Expand Down Expand Up @@ -144,10 +142,6 @@ class ShellyDuoDevice extends Homey.Device {
}, 63000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = ShellyDuoDevice;
6 changes: 0 additions & 6 deletions drivers/shellydw/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class ShellydwDevice extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();

Expand Down Expand Up @@ -106,10 +104,6 @@ class ShellydwDevice extends Homey.Device {
}, 4000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = ShellydwDevice;
5 changes: 0 additions & 5 deletions drivers/shellyem/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ShellyEmDevice extends Homey.Device {
new Homey.FlowCardTriggerDevice('triggerMeterPowerConsumed').register();
new Homey.FlowCardTriggerDevice('triggerMeterPowerReturned').register();
new Homey.FlowCardTriggerDevice('triggerReactivePower').register();
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.setAvailable();

Expand Down Expand Up @@ -65,10 +64,6 @@ class ShellyEmDevice extends Homey.Device {
return Homey.ManagerDrivers.getDriver('shellyem').loadDevices();
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = ShellyEmDevice;
6 changes: 0 additions & 6 deletions drivers/shellyflood/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class ShellyFloodDevice extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.setAvailable();

// ADD MISSING CAPABILITIES
Expand Down Expand Up @@ -67,10 +65,6 @@ class ShellyFloodDevice extends Homey.Device {
}

// HELPER FUNCTIONS
triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

updateReportStatus(device, status) {
var alarm = Number(status.flood) == 0 ? false : true;

Expand Down
6 changes: 0 additions & 6 deletions drivers/shellyi3/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class Shellyi3Device extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.registerCapabilityListener('button.callbackevents', async () => {
this.addCallbackUrls();
});
Expand Down Expand Up @@ -169,10 +167,6 @@ class Shellyi3Device extends Homey.Device {
}
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = Shellyi3Device;
1 change: 0 additions & 1 deletion drivers/shellyrgbw2white/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const util = require('/lib/util.js');
class ShellyRGBW2WhiteDevice extends Homey.Device {

onInit() {

this.setAvailable();

// LISTENERS FOR UPDATING CAPABILITIES
Expand Down
6 changes: 0 additions & 6 deletions drivers/shellyvintage/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const util = require('/lib/util.js');
class ShellyVintageDevice extends Homey.Device {

onInit() {
new Homey.FlowCardTriggerDevice('triggerCallbackEvents').register();

this.pollDevice();
this.setAvailable();

Expand Down Expand Up @@ -134,10 +132,6 @@ class ShellyVintageDevice extends Homey.Device {
}, 63000);
}

triggerCallbackEvents(action) {
return Homey.ManagerFlow.getCard('trigger', "triggerCallbackEvents").trigger(this, {"action": action}, {})
}

}

module.exports = ShellyVintageDevice;
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.

Loading

0 comments on commit 45da977

Please sign in to comment.