-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add tilt max and min angle constraints #13
Add tilt max and min angle constraints #13
Conversation
…thing over 1 but nothing under one so try flipping the max angle value in the logic
Thank you for adding this feature. I only had a quick glance at the PR. Since I currently don't have a lot of free time, a proper review and testing will have to wait (sorry :/).
|
…gle to full test yaml
@TillFleisch no worries! I'm happy to make an attempt at contributing 😃
Yep - good call (Edit: Done)
I'm actively using this and not seeing any flickering. If we did see a need to add margin I would definitely go the route of making a separate margin for angle rather than re-using distance.
I was literally thinking the same thing when I was writing it, but for the sake of making it work and reducing chance of failure I just duplicated. Very open to this modification though |
I look over this and added some things, I felt were necessary:
I will look over this once more later today. Feel free to play around/find bugs/criticize Edit: the config could also be consolidated further. The max distance and angles could be covered by a single schema, which has a type attribute to determine which action is intended. This would break existing configs though... |
@@ -52,12 +52,16 @@ namespace esphome::ld2450 | |||
ESP_LOGCONFIG(TAG, "LD2450 Hub: %s", name_); | |||
ESP_LOGCONFIG(TAG, " fast_off_detection: %s", fast_off_detection_ ? "True" : "False"); | |||
ESP_LOGCONFIG(TAG, " flip_x_axis: %s", flip_x_axis_ ? "True" : "False"); | |||
ESP_LOGCONFIG(TAG, " max_detection_tilt_angle: %i °", max_detection_tilt_angle_); | |||
ESP_LOGCONFIG(TAG, " min_detection_tilt_angle: %i °", min_detection_tilt_angle_); | |||
ESP_LOGCONFIG(TAG, " max_detection_distance: %i mm", max_detection_distance_); | |||
ESP_LOGCONFIG(TAG, " max_distance_margin: %i mm", max_distance_margin_); |
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.
angle margin missing
Thank you @bsell93 for adding this feature! :) |
Thanks for helping me get it across the finish line |
This gives the ability to control max/min value of the angles detected - similar to how "Max Distance" works.
Defaults to -60 to 60deg, which I believe is max detection range; controls are optional.