Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Weber committed Nov 19, 2024
1 parent 4ccf308 commit 48c1726
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,27 @@ class Uvr16xxBlNet extends utils.Adapter {
* @returns {Promise<{success: boolean, stateValues: Object, deviceInfo: Object, units: Object}>} - The result of the test read with success status, state values, device info, and units.
*/
async readSystemConfiguration() {
return new Promise(async (resolve, reject) => {
return new Promise((resolve) => {
let stateValues;
let deviceInfo;

// Try to read some metadata on the device
try {
deviceInfo = await this.readDeviceInfo();
deviceInfo = this.readDeviceInfo();
this.log.debug("deviceInfo is defined as:" + JSON.stringify(deviceInfo));
} catch (error) {
this.log.debug("readDeviceInfo function error: " + error);
resolve({
success: false,
stateValues: {},
deviceInfo: {},
units: {}
});
return;
}

try {
stateValues = await this.fetchStateValuesFromDevice();
stateValues = this.fetchStateValuesFromDevice();
const units = {};

// Determine units based on bits 4-6 of the high byte for inputs
Expand Down Expand Up @@ -574,7 +581,6 @@ class Uvr16xxBlNet extends utils.Adapter {
const stateValues = {};
const maxRetries = 5; // Maximale Anzahl der Wiederholungen
let attempt = 0; // Aktueller Versuch
let client;
const ipAddress = this.config.ip_address; // IP address from the config
const port = this.config.port; // Port from the config
const READ_CURRENT_DATA = 0xAB; // Command byte to read current data
Expand Down

0 comments on commit 48c1726

Please sign in to comment.