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

Bug and device fix #2357

Merged
merged 15 commits into from
Jan 12, 2025
Merged

Bug and device fix #2357

merged 15 commits into from
Jan 12, 2025

Conversation

asgothian
Copy link
Collaborator

Fix battery status for Ikea Parasoll Devices
Fix random crashes due to unhandled promise rejection (I hope I caught them all now)

Test: convertGet Changes ?
change log message
replaced error reporting via JSON.stringify(error) to specific messaging via error.message and error.stack
Added try/catch to a number of internal functions when calling zigbee-herdsman or zigbee-herdsman-converters functions
updated logging
Fix Ikea Parasoll battery (can be queried again)
Possibly fix random crashes due to unhandled promise rejection
Lint
@@ -85,7 +85,7 @@
}

} catch (error) {
if (error) this.error(`getGroupMembersFromController: error is ${JSON.stringify(error)} ${JSON.stringify(new Error().stack)}`);
if (error) this.error(`getGroupMembersFromController: error is ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);

Check warning

Code scanning / CodeQL

Useless conditional Warning

This use of variable 'error' always evaluates to true.
@@ -85,7 +85,7 @@
}

} catch (error) {
if (error) this.error(`getGroupMembersFromController: error is ${JSON.stringify(error)} ${JSON.stringify(new Error().stack)}`);
if (error) this.error(`getGroupMembersFromController: error is ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);

Check warning

Code scanning / CodeQL

Useless conditional Warning

This use of variable 'error' always evaluates to true.
lib/statescontroller.js Dismissed Show dismissed Hide dismissed
this.error(`error saving device names: ${JSON.stringify(err)}`);
fs.writeFile(this.dev_names_fn, JSON.stringify(savedDeviceNamesDB, null, 2), error => {
if (error) {
this.error(`error saving device names: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);

Check warning

Code scanning / CodeQL

Useless conditional Warning

This use of variable 'error' always evaluates to true.
@@ -369,7 +379,7 @@
} catch (error) {
this.sendError(error);
if (error) {
this.error(`getGroupMembersFromController: error is ${JSON.stringify(error)} ${JSON.stringify(new Error().stack)}`);
this.error(`getGroupMembersFromController: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);

Check warning

Code scanning / CodeQL

Useless conditional Warning

This use of variable 'error' always evaluates to true.
@@ -369,7 +379,7 @@
} catch (error) {
this.sendError(error);
if (error) {
this.error(`getGroupMembersFromController: error is ${JSON.stringify(error)} ${JSON.stringify(new Error().stack)}`);
this.error(`getGroupMembersFromController: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);

Check warning

Code scanning / CodeQL

Useless conditional Warning

This use of variable 'error' always evaluates to true.
}
catch (error)
{
this.log.error(`error sending ${type} ${cmd} to endpoint: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (95% of all statements in
the enclosing function
have an explicit semicolon).
this.log.debug(`Device query for '${entity.device.ieeeAddr}' started`);
if (has_elevated_debug)
this.log.warn(`ELEVATED O06: Device query for '${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID}' triggered`);
let t;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable t.
@asgothian asgothian merged commit 99e52f0 into ioBroker:master Jan 12, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant