Skip to content

Commit

Permalink
Release 3.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Sep 7, 2021
1 parent db39957 commit 8db91b1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .homeycompose/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"Shelly Vintage"
]
},
"version": "3.3.6",
"version": "3.3.7",
"compatibility": ">=5.0.0",
"platforms": [ "local", "cloud" ],
"author": {
Expand Down
12 changes: 6 additions & 6 deletions drivers/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class ShellyDevice extends Homey.Device {
/* input_1 */
if (result.inputs.hasOwnProperty([0]) && this.hasCapability('input_1')) {
let input_1 = result.inputs[0].input == 1 ? true : false;
if (input_1 != this.getCapabilityValue('input_1')) {
if (input_1 !== this.getCapabilityValue('input_1')) {
this.updateCapabilityValue('input_1', input_1);
if (input_1) {
this.homey.flow.getDeviceTriggerCard('triggerInput1On').trigger(this, {}, {});
Expand All @@ -463,7 +463,7 @@ class ShellyDevice extends Homey.Device {
if (result.inputs.hasOwnProperty([1])) {
if (this.hasCapability('input_2')) {
let input_2 = result.inputs[1].input == 1 ? true : false;
if (input_2 != this.getCapabilityValue('input_2')) {
if (input_2 !== this.getCapabilityValue('input_2')) {
this.updateCapabilityValue('input_2', input_2);
if (input_2) {
this.homey.flow.getDeviceTriggerCard('triggerInput2On').trigger(this, {}, {});
Expand All @@ -472,15 +472,15 @@ class ShellyDevice extends Homey.Device {
}
}
// input/action events for cloud devices
if (this.getStoreValue('communication') === 'cloud' && result.inputs[1].event_cnt > 0 && (result.inputs[1].event_cnt > this.getStoreValue('event_cnt')) &&result.inputs[1].event) {
if (this.getStoreValue('communication') === 'cloud' && result.inputs[1].event_cnt > 0 && (result.inputs[1].event_cnt > this.getStoreValue('event_cnt')) && result.inputs[1].event) {
var action1 = this.util.getActionEventDescription(result.inputs[1].event) + '_2';
this.setStoreValue('event_cnt', result.inputs[1].event_cnt);
this.homey.flow.getTriggerCard('triggerCallbacks').trigger({"id": this.getData().id, "device": this.getName(), "action": action1 }, {"id": this.getData().id, "device": this.getName(), "action": action1 });
}
} else {
let input_2 = result.inputs[1].input == 1 ? true : false;
if (input_2 != this.getCapabilityValue('input_1')) {
this.updateCapabilityValue('input_1', input_2);
if (input_2 !== this.getCapabilityValue('input_1')) {
this.updateCapabilityValue('input_1', input_2, channel);
if (input_2) {
this.homey.flow.getDeviceTriggerCard('triggerInput1On').trigger(this, {}, {});
} else {
Expand All @@ -499,7 +499,7 @@ class ShellyDevice extends Homey.Device {
/* input_3 */
if (result.inputs.hasOwnProperty([2]) && this.hasCapability('input_3')) {
let input_3 = result.inputs[2].input == 1 ? true : false;
if (input_3 != this.getCapabilityValue('input_3')) {
if (input_3 !== this.getCapabilityValue('input_3')) {
this.updateCapabilityValue('input_3', input_3);
if (input_3) {
this.homey.flow.getDeviceTriggerCard('triggerInput3On').trigger(this, {}, {});
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.3.6",
"version": "3.3.7",
"description": "Homey app for controlling Shelly devices",
"main": "app.js",
"scripts": {
Expand Down

0 comments on commit 8db91b1

Please sign in to comment.