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

No notifications are listed #3

Open
nadrog opened this issue Dec 29, 2023 · 1 comment
Open

No notifications are listed #3

nadrog opened this issue Dec 29, 2023 · 1 comment

Comments

@nadrog
Copy link

nadrog commented Dec 29, 2023

I see the following two notifications in the Data Browse (they were created by @signalk/zones), but I don't see anything in Notification Manager.

notifications.environment.inside.humidity:

{
  "state": "alert",
  "message": "Humidity: humid (50% - 70%)",
  "method": [],
  "timestamp": "2023-12-29T16:31:01.607Z"
}

notifications.environment.inside.pressure:

{
  "state": "normal",
  "message": "Pressure is normal (96kPa - 104kPa)",
  "method": [],
  "timestamp": "2023-12-29T16:31:01.610Z"
}

SignalK: 2.4.1
signalk-notifications: 1.1.1
@signalk/zones: 1.1.0
node: v18.18.2
npm: 9.8.1

@nadrog
Copy link
Author

nadrog commented Feb 11, 2024

OK, I fixed it on my installation by checking whether position is null and using coordinates 0,0 instead.
The error is here: index.js:147.

The following code works but is of course far from elegant:

if ( position === null || position.latitude === null || position.longitude === null ){
  lat = 0;
  lon = 0;
} else {
  lat = position.latitude;
  lon = position.longitude;
}
updateDatabase(ts, lat, lon, path, value.state, value.message);

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

No branches or pull requests

1 participant