feat: support multiple devices in devices:history - #848
Open
sungmpar wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 9783acf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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
Issue #643 asks for a way to query multiple devices with
devices:historyand export their records together. This change makes the positional device argument variadic and uses one combined history stream, avoiding separate CLI runs and manual result merging.locationIdis checked to be a non-empty string before history or output begins; any metadata lookup failure or missing, non-string, or emptylocationIdaborts before any history request, table, formatter, or output write. Multiple unique devices use ordered device IDs and first-seen deduplicated locations, with a scalar location when all devices share one.--outputcontinue to format and write one combined result.before,after, UTC formatting, and warning behavior apply to the combined stream.devices:history [id-or-index..], and a patch changeset is included.locations:historytest now imports its type-onlyCommandArgsfrom the command it exercises. The variadic device-history type exposed this pre-existing mismatch during compilation; the correction does not change runtime or test behavior.Testing
npm run test -- --runTestsByPath src/__tests__/commands/locations/history.test.ts --no-watchman— passed, 1 suite / 4 testsnpm run test -- --runTestsByPath src/__tests__/commands/devices/history.test.ts --no-watchman— passed, 1 suite / 19 testsnpm run test -- --runTestsByPath src/__tests__/lib/command/util/history.test.ts src/__tests__/lib/command/command-util.test.ts src/__tests__/lib/command/util/util-util.test.ts src/__tests__/lib/command/util/devices-choose.test.ts src/__tests__/commands/locations/history.test.ts --no-watchman— passed, 5 suites / 91 testsnpm run compile— passednpm run build— passed; clean, compile, and README generation completednode dist/src/run.js devices:history --help— passed and shows the variadic syntaxnpm run lint— passednpm run test -- --no-watchman— passed, 175 suites; 1,581 passed, 2 todo, 1,583 totalgit diff --check— passedThe automated coverage validates request construction and output behavior with mocks; no live SmartThings account, API, or hardware validation was performed.
Closes #643
Checklist
npm run lintproduces no warnings/errors)