Skip to content

Commit

Permalink
fixed #130
Browse files Browse the repository at this point in the history
every node has an own axios instance now
  • Loading branch information
windkh committed Jun 30, 2024
1 parent dad8948 commit f4a38d1
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [10.26.0] - 2024-06-30
### added verbose logging - [#130](https://github.com/windkh/node-red-contrib-shelly/issues/130)
### every node has an own axios instance now to fix #157

## [10.25.2] - 2024-06-24
### fixed gen 3 problems: device was not detected correctly - [#159](https://github.com/windkh/node-red-contrib-shelly/issues/159)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-shelly",
"version": "10.25.2",
"version": "10.26.0",
"description": "Shelly nodes.",
"node-red": {
"version": ">=0.1.0",
Expand Down
43 changes: 38 additions & 5 deletions shelly/99-shelly.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ <h3>Details</h3>
hostname: { value:"" },
description: { value:"" },
mode: { value: "polling", required: true },

verbose: { value: false, required: true },

// callback
server: { value:"", type: "shelly-gen1-server", validate:function(v) {
let mode = $("#node-input-mode").val();
Expand Down Expand Up @@ -279,6 +280,14 @@ <h3>Details</h3>
<label for="node-input-outputs"><i class="fa fa-envelope"></i> Output Count</label>
<input type="text" id="node-input-outputs">
</div>

<hr align="middle"/>

<div class="form-row">
<label for="node-input-verbose"><i class="fa fa-pencil"></i> Verbose Logging</label>
<input type="checkbox" id="node-input-verbose" style="display: inline-block; width: auto; vertical-align: top;">
</div>

</script>

<script type="text/x-red" data-help-name="shelly-gen1">
Expand Down Expand Up @@ -390,7 +399,8 @@ <h3>Details</h3>
hostname: { value:"" },
description: { value:"" },
mode: { value: "polling", required: true },

verbose: { value: false, required: true },

// callback
server: { value:"", type: "shelly-gen2-server", validate:function(v) {
let mode = $("#node-input-mode").val();
Expand Down Expand Up @@ -429,14 +439,29 @@ <h3>Details</h3>
return this.description?"node_label_italic":"";
},
oneditprepare: function() {
let populateDeviceTypes = function() {
$.getJSON('node-red-contrib-shelly-getidevicetypesgen2', function(deviceTypeInfos) {
for (let i = 0; i <= deviceTypeInfos.length; i++) {
let deviceTypeInfo = deviceTypeInfos[i];
if (deviceTypeInfo !== undefined) {
$('#node-input-devicetype').append('<option value="' + deviceTypeInfo.deviceType + '">' + deviceTypeInfo.description + '</option>');
}
}
});
};
populateDeviceTypes();
debugger;
$('#node-input-devicetype').val(this.devicetype); // TODO: hier richtigen wert setzen bei start


let updateDeviceType = function() {
let devicetype = $("#node-input-devicetype").val();
// TODO: for future usage
debugger;
};
updateDeviceType();
$("#node-input-devicetype").change(updateDeviceType);



// polling or callback
var updateMode = function() {
var mode = $("#node-input-mode").val();
Expand Down Expand Up @@ -475,7 +500,6 @@ <h3>Details</h3>
</div>
</div>
</div>
<div class="form-tips" style="width: auto"><b>Tip:</b> For BluGateway please choose callback with event as output!</div>

<div class="form-row" style="margin-left: 20px">
<div class="form-row">
Expand All @@ -502,6 +526,8 @@ <h3>Details</h3>

<hr align="middle"/>

<div class="form-tips" style="width: auto"><b>Tip:</b> For BluGateway please choose callback with event as output!</div>

<div class="form-row">
<label for="node-input-mode"><i class="fa fa-link"></i> Mode</label>
<select id="node-input-mode" style="width:70%">
Expand Down Expand Up @@ -555,6 +581,13 @@ <h3>Details</h3>
<input type="checkbox" id="node-input-getstatusoncommand" style="display: inline-block; width: auto; vertical-align: top"> Enable status output after each command
</div>

<hr align="middle"/>

<div class="form-row">
<label for="node-input-verbose"><i class="fa fa-pencil"></i> Verbose Logging</label>
<input type="checkbox" id="node-input-verbose" style="display: inline-block; width: auto; vertical-align: top;">
</div>

</script>

<script type="text/x-red" data-help-name="shelly-gen2">
Expand Down
Loading

0 comments on commit f4a38d1

Please sign in to comment.