feat: add created_at and updated_at fields to device responses#139
Merged
mguida22 merged 3 commits intofoxglove:mainfrom Feb 24, 2026
Merged
feat: add created_at and updated_at fields to device responses#139mguida22 merged 3 commits intofoxglove:mainfrom
mguida22 merged 3 commits intofoxglove:mainfrom
Conversation
The device-related methods (get_device, get_devices, create_device, update_device) now return created_at and updated_at timestamp fields that are available in the Foxglove API response but were previously omitted. This follows the same pattern used by _event_dict() for event timestamps. The timestamps are parsed using arrow and returned as datetime objects. If the API response doesn't include these fields, None is returned. Changes: - Add _device_dict() helper function for consistent device response formatting - Update get_device, get_devices, create_device, update_device to use _device_dict - Update tests to verify new timestamp fields
Member
|
Thanks @BenniRip for the improvement, this looks like a good change. Sorry for just seeing this now, do you want to resolve the merge conflicts and we'll get this in? I'm also happy to take this over if you're busy. |
fcea75f to
5deda24
Compare
Contributor
Author
|
Hi @mguida22 ! Thanks for having a look. I resolved the conflicts, but something in the claude review workflow doesn't seem to work. Would be great if you could have a look. Thanks a lot! |
mguida22
approved these changes
Feb 24, 2026
Member
mguida22
left a comment
There was a problem hiding this comment.
Thank you!
The failing workflow won't run on forks since it can't access secrets there, I disabled it.
Member
|
This will go out in the next release in a few days |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
Add
created_atandupdated_attimestamp fields to device response dictionaries inget_device,get_devices,create_device, andupdate_devicemethods.Description
Problem:
The Foxglove API returns
createdAtandupdatedAtfields for devices, but the Python client was filtering them out. This made it impossible to determine when a device was created or last updated.Use case:
We needed to clean up old devices based on their creation date, but couldn't because the timestamps weren't exposed by the client.
Solution:
This PR adds these timestamp fields to the device response, following the same pattern already used by
_event_dict()for events. A new_device_dict()helper ensures consistent formatting across all device-related methods.Timestamps are parsed using arrow and returned as datetime objects. If the API response doesn't include these fields (for backwards compatibility),
Noneis returned.Backwards compatibility:
This change is fully backwards compatible. Existing code accessing the 4 original fields (
id,name,properties,project_id) will continue to work unchanged. The two new fields (created_at,updated_at) are simply added to the response.Updated the tests accordingly.