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

device.visible has no effect on the map #62

Closed
BNNorman opened this issue May 1, 2020 · 7 comments
Closed

device.visible has no effect on the map #62

BNNorman opened this issue May 1, 2020 · 7 comments
Labels
fixed It's fixed!

Comments

@BNNorman
Copy link

BNNorman commented May 1, 2020

device.visible was implemented in the device table so we could hide sensors from the map however sensors still remain visible when device.visible is set to zero.

I have set visible=0 for the "bonus_a" sensor (see screenshot) which was used for a demo at the arena last October but it can still be seen. This is not a caching issue because I used a browser I don't normally use to double check that.

image

Please can this filter condition be added to the SQL to eliminate sensors which have stopped sending data for any reason. Then I can remove the dead devices.

This will be better for anyone looking at the map as it shows we are active. On the downside it shows we have fewer active devices - can't win!

Thanks

@bsimmo
Copy link
Member

bsimmo commented May 1, 2020

on the plus side I makes the colour mapping make more sense.

#2 idea
after this a way to automate it,

  • a cron job to check on date/last-sceen to flip the setting and vice versa.

@BNNorman
Copy link
Author

BNNorman commented May 1, 2020

cron job is a good idea but deciding how long to wait is the question. Less than a month could be waiting for repair. longer could be dead and buried.
Won't be quick - need to write a python program in amongst the current pixelbot stuff I'm doing whilst Rob focusses on writing his next source of income.

@sbrl
Copy link
Collaborator

sbrl commented May 1, 2020

Great catch - thanks for this. I think a filter in the SQL is a great idea, as it allows us to hide dead / test / irrelevant sensors.

However, I think there's room for colour-coding the SVG marker too. Since we already have last_seen, the marker shouldn't be too much of a problem, but dynamically setting the marker in Leaflet.js in a manner that's both future-proof and extensible in the future is more bothersome than it should be (but I've now got an idea of how to do it - it's just a case of doing it).

@BNNorman
Copy link
Author

BNNorman commented May 1, 2020 via email

@sbrl
Copy link
Collaborator

sbrl commented May 1, 2020

Fixed - this should show up in beta soon.

We've already got a task in #36 about the marker colouring, so I'm going to close this issue.

@sbrl sbrl closed this as completed May 1, 2020
@sbrl sbrl added the fixed It's fixed! label May 1, 2020
@BNNorman
Copy link
Author

BNNorman commented May 2, 2020

A cron job has been added which should run once per week at 5a.m.

It will set/reset the device visible flag. I.e. if a device hasn't sent data for 31 days or more visible is set to 0. If the device then comes back on line it will be made visible again.

@sbrl
Copy link
Collaborator

sbrl commented May 3, 2020

Cool, thansk @BNNorman! I'll let you know when I implement the device marker colouring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed It's fixed!
Projects
None yet
Development

No branches or pull requests

3 participants