Skip to content

Commit

Permalink
feat: allow configuring log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
inwaar committed Dec 28, 2024
1 parent 349c1a6 commit dff53bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions gree-hvac/gree-hvac.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
category: 'devices',
color: '#98cecf',
defaults: {
name: {value: "Gree HVAC"},
device: {value: "", type: "gree-hvac-config", required: true},
interval: {value: "3", required: true},
debug: {value: false}
name: { value: "Gree HVAC" },
device: { value: "", type: "gree-hvac-config", required: true },
interval: { value: "3", required: true },
logLevel: { value: "error", required: true }
},
inputs: 1,
outputs: 2,
Expand Down Expand Up @@ -34,8 +34,13 @@
</div>

<div class="form-row">
<label for="node-input-debug"><i class="icon-tag"></i> Debug</label>
<input type="checkbox" id="node-input-debug">
<label for="node-input-logLevel"><i class="icon-tag"></i> Log-level</label>
<select id="node-input-logLevel">
<option value="error">Error</option>
<option value="warn">Warn</option>
<option value="info">Info</option>
<option value="debug">Debug</option>
</select>
</div>
</script>

Expand Down
2 changes: 1 addition & 1 deletion gree-hvac/gree-hvac.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function (RED) {
host: device.host,
pollingInterval: pollingInterval,
pollingTimeout: pollingInterval / 2,
debug: config.debug,
logLevel: config.logLevel,
});

const statusConnected = () => {
Expand Down

0 comments on commit dff53bf

Please sign in to comment.