Skip to content

Commit

Permalink
fix: closes #23 and removes console output (#24)
Browse files Browse the repository at this point in the history
* fix: closes #23 and removes console output
* fix: only use ci on main and pr
  • Loading branch information
mabunixda authored Dec 16, 2021
1 parent c3ab56c commit d3385e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- '**'
- 'main'
pull_request:
branches:
- '**'
Expand Down
5 changes: 0 additions & 5 deletions fronius/fronius.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = function(RED) {
'use strict';
const fronius = require('node-fronius-solar');
const util = require('util');

/**
* fronius inverter node
Expand Down Expand Up @@ -37,7 +36,6 @@ module.exports = function(RED) {
deviceId: node.deviceid,
version: node.inverter.apiversion,
};
console.log(node.options);

node.on('input', function(msg) {
node.processCommand(msg);
Expand All @@ -59,18 +57,15 @@ module.exports = function(RED) {
FroniusControl.prototype.processCommand = function(msg) {
msg.payload = {};
const node = this;
console.log(node.querytype);
if (node.querytype === 'inverter') {
fronius.GetInverterRealtimeData(node.options).then(function(json) { // eslint-disable-line
console.log(util.inspect(json, {depth: 4, colors: true}));
if (!node.isValidHead(json)) {
node.setNodeStatus('orange', json.Head.Status.UserMessage);
return;
}
msg.payload = json.Body.Data;
node.send(msg);
}).catch(function(e) {
console.log(e);
node.setNodeStatus('red', e);
});
} else if (node.querytype === 'components') {
Expand Down

0 comments on commit d3385e9

Please sign in to comment.