Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta #28

Merged
merged 42 commits into from
Feb 27, 2021
Merged

Beta #28

Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
905023b
Update README.md
yhaugom Feb 20, 2019
01924be
Update app.json
yhaugom Feb 22, 2019
012129c
Update app.json
yhaugom Feb 22, 2019
aa016cc
Update app.json
yhaugom Feb 24, 2019
36b4ad5
Merge branch 'master' into beta
yhaugom Mar 12, 2019
975e82d
Merge branch 'master' into beta
yhaugom Mar 12, 2019
cfb66c9
Update README.md
yhaugom Mar 12, 2019
1c65178
Merge branch 'master' into beta
yhaugom Mar 12, 2019
cfcc5d9
Merge branch 'master' into beta
yhaugom Jan 11, 2020
dcb7e55
Update app.json
yhaugom Jan 12, 2020
8aa466b
Update device.js
yhaugom Jan 14, 2020
4fdaf6d
Update app.json
yhaugom Jan 14, 2020
bbeeb5d
Added readme.txt
yhaugom Jan 14, 2020
cfc8d46
Update .homeychangelog.json
yhaugom Jan 14, 2020
d2a97cd
Update .homeychangelog.json
yhaugom Jan 14, 2020
0d5e470
Update README.txt
yhaugom Jan 14, 2020
e347d8e
Started implementing power reset
yhaugom Feb 2, 2020
433e024
Update app.json
yhaugom Feb 2, 2020
011d2a6
Working on meterReset
yhaugom Feb 3, 2020
41e6794
Migrated to Homey Compose
yhaugom Feb 3, 2020
8136881
Updated npm node_modules
yhaugom Feb 5, 2020
28a7b56
package files update
yhaugom Feb 5, 2020
8e15878
Added capabilities to power plug mini
yhaugom Feb 9, 2020
b981e17
Update app.json
yhaugom Feb 9, 2020
a6eb997
Revert "Update app.json"
yhaugom Feb 9, 2020
f3c8d58
Update device.js
yhaugom Feb 9, 2020
1508fef
Looking into meter reset
yhaugom Mar 15, 2020
5059d3d
Updated node_modules homey-meshdriver
yhaugom Mar 24, 2020
2e29a07
updated mesndriver
yhaugom May 10, 2020
fb22171
meshdriver updated
yhaugom May 10, 2020
22ca9e6
SDK v3, comp >=5 and node mod updates
yhaugom Aug 30, 2020
173316b
Update app.js
yhaugom Sep 13, 2020
dbad106
Node modules patches and updates
yhaugom Sep 27, 2020
6069ccf
Updating to ZwaveDevice and SDK v3
yhaugom Sep 27, 2020
008f9fa
Small text correction
yhaugom Sep 27, 2020
246e409
Update app.json
yhaugom Sep 27, 2020
5f347aa
Version bump
yhaugom Sep 27, 2020
f0f92b2
Update of node homey-zwavedriver
yhaugom Feb 22, 2021
b90c7fe
node zwavedriver update
yhaugom Feb 22, 2021
10a963c
Updates to descriptions, readme, and exclusion message
yhaugom Feb 22, 2021
0efc222
app.json compsed from sub-files
yhaugom Feb 22, 2021
8a3e6e0
Update to tzwp-102 meter reset
yhaugom Feb 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update app.js
Updating to Homey apps sdk v3
  • Loading branch information
yhaugom committed Sep 13, 2020
commit 173316bc670efa6c5af6d763fbc94e6957767c3c
21 changes: 10 additions & 11 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,30 @@ const Homey = require('homey');

class TelldusApp extends Homey.App {

onInit() {
async onInit() {
let currentPowerCondition = this.homey.flow.getConditionCard('current_power');



let currentPowerCondition = new Homey.FlowCardCondition('current_power');
currentPowerCondition
.register()
.registerRunListener(( args, state ) => {
.registerRunListener(async( args, state ) => {
var power = args.plugin_switch_mini.getCapabilityValue('measure_power');
var margin = args.W * args.errormargin / 100;

if ((power >= args.W - margin) && (power < args.W + margin))
{
return Promise.resolve( true );
return true;
}

return Promise.resolve( false );
return false;
});

let resetMeterAction = new Homey.FlowCardAction('TZWP-102_reset_meter');
let resetMeterAction = this.homey.flow.getActionCard('TZWP-102_reset_meter');
resetMeterAction
.register()
.registerRunListener((args, state) => {
.registerRunListener(async(args, state) => {
if (this.node &&
this.node.CommandClass.COMMAND_CLASS_METER) {
this.log('callback METER_RESET triggered');
return Promise.resolve(this.node.CommandClass.COMMAND_CLASS_METER.METER_RESET({}));
return this.node.CommandClass.COMMAND_CLASS_METER.METER_RESET({});
}
return Promise.reject('unknown_error');
});
Expand Down