-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Include last seen in device boxes on graphviz map #1633
Conversation
Ok, I don't know how to fix that Travis error. Seems state isn't visible within onZigbeeMessage but code runs just fine regardless. Any suggestions? |
I've did some refactoring, can you check if everything is OK, then I will merge it. |
Nope. I get an error which seems related to 'this.lastSeenMap' being undefined at that point due to 'this' context not available in graphviz function. Needs the context passed but I am not sure on correct way to do that.
|
Can you check again? |
Tried to keep the logic concise but couldn't use a ternary to build the label. Problem was 'unknown' can't be passed to utils.formatDate so had to separate out the various scenarios. |
I see, thanks! |
* Include last seen in device boxes on graphviz map * Refactor * Fix test cases * Bind * Refactor last seen label construction * style fix
Adds a last seen timestamp to the devices on network map alongside the online/offline status. Coordinator always gets an absolute timestamp but other devices get whatever format is configured for advanced last_seen or a relative time if last_seen isn't configured.
Had to include capturing of last_seen to state for every message received so this works regardless of whether availability is configured or not.
This change highlights that something still isn't right with status as routers pretty much always show as offline even when active but looking into that is a problem for another day.
It maps the map a bit busier but hopefully this change can help users ascertain if problems they are experiencing are with the map or actual network communications.
Here's an example map fragment.
![image](https://user-images.githubusercontent.com/40568549/59509691-18758f00-8ef5-11e9-9062-4b0d8a98aa19.png)