Repository navigation
Add devices.statistics for Control Tower device counters - #72
Merged
Merged
Conversation
Wrap GET /device/:device_id/statistics, the Control Tower route that returns the input and output counters of a device over time. Adds the DeviceStatisticsQuery and DeviceStatistic types, parses time into a datetime, and documents the method in the Sphinx docs.
4 tasks done
Member
Author
|
Approve Improvements
Risk (CIA)Likelihood: 🟢 Low | Impact: 🟢 Low | Exposure: 🟢 Low. |
mateuscardosodeveloper
approved these changes
Oct 5, 2026
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.
Summary
Adds
resources.devices.statistics(deviceID, queryParams=None), which wrapsGET /device/:device_id/statistics. That Control Tower route returns a device'sdevice_inputanddevice_outputcounters over time, and the SDK had no method for it. The PR also adds theDeviceStatisticsQueryandDeviceStatisticTypedDicts, parsestimeinto adatetime, and documents the method and types in the Sphinx docs.Bumps the version to 5.1.8 in
pyproject.tomlanduv.lock.Test plan
testStatisticsandtestStatisticsWithoutQueryintests/Resources/test_devices.pyuv run pytest tests(224 passed)uv run ruff check srcpassessphinx-buildrenders the new section, and theDeviceStatisticsQuery/DeviceStatisticrefs resolveRisk (CIA)
Likelihood: 🟢 Low | Impact: 🟢 Low | Exposure: 🟢 Low
Related