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.
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
Expose moving as motion sensor #956
base: master
Are you sure you want to change the base?
Expose moving as motion sensor #956
Changes from all commits
bf4b05f
a117ab6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Enhance the changelog entry with more details.
The current entry could be more descriptive. Consider expanding it to match the style of other entries in the changelog by:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to add a link to this PR at the end of this line (as I usually do for lines in the changelog, so people can find more information if they want it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itavero, you can simply append the link to PR #956 at the end of the line, similar to how you usually reference other PRs in the changelog. For instance:
Expose moving state as motion sensor for SmartThings/Samjin Multipurpose sensors (see #956)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not add the details you suggested (as there probably more devices that use this same property). The link seems fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itavero Understood! We'll keep it concise and just include the link. Thank you for clarifying.
(_/)
(·_·) …
/ \ … (sigh)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
💡 Codebase verification
Refactor string concatenation to template literals across motion sensor handlers
Found similar string concatenation pattern in other motion sensor handlers. Let's update all instances for consistency:
src/converters/basic_sensors/moving.ts
: Change to`${MovingSensorHandler.exposesName} ${t ?? ''}`.trim()
src/converters/basic_sensors/vibration.ts
: Change to`${VibrationSensorHandler.exposesName} ${t ?? ''}`.trim()
The HomeKit service configuration is consistent across all implementations, using the correct characteristic
hap.Characteristic.MotionDetected
with proper initialization.🔗 Analysis chain
Refactor string concatenation to use template literals.
The constructor implementation is correct, but we can improve readability by using template literals.
Apply this change:
Let's verify the HomeKit service configuration:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 861
🧰 Tools
🪛 Biome
[error] 16-16: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Refactor identifier generation to use template literals.
The identifier generation logic is correct, but we can improve readability by using template literals.
Apply these changes:
📝 Committable suggestion
🧰 Tools
🪛 Biome
[error] 24-24: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
[error] 26-26: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Implementation successfully meets PR objectives.
The
MovingSensorHandler
implementation effectively exposes the "moving" state as a motion sensor while following established patterns and HomeKit standards. The code is well-structured and maintainable.Consider documenting the following in the PR description or README:
🧰 Tools
🪛 Biome
[error] 16-16: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
[error] 24-24: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
[error] 26-26: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Use template literals for string concatenation
Consider using template literals for better readability.
📝 Committable suggestion
🧰 Tools
🪛 Biome
[error] 664-664: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)