Skip to content
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

ZY-M201 fix service call error for detection distance slider #1355

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

blakadder
Copy link
Contributor

fixes service call error that pops up when slider is set to 5.5

image

Doesn't need to respect scale from tuya
@@ -58,7 +58,7 @@ secondary_entities:
max: 550
mapping:
- scale: 100
step: 100
# step: 100
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did the 100 come from in the first place? Does the device accept being set to other values than 1.5, 2.5, 3.5, 4.5, 5.5? If not maybe a select is better for this setting.

@make-all
Copy link
Owner

make-all commented Nov 29, 2023

There also seems to be a bug based on that error message (a < where there should be a <= perhaps). If the step was the issue, then i would expect "(6.0) must be between 1.5 and 5.5" when trying to set to 5.5, as it would be rounded up. Or maybe the bug is just that the error message uses the original value, where it is the already scaled and rounded value that is out of range.

@blakadder
Copy link
Contributor Author

Step was the initial issue but while playing around with it I realised it accepts steps of 1 and reports them back to the app despite the tuya iot data having step: 100

  - abilityId: 4
    accessMode: rw
    code: far_detection
    description: ''
    extensions:
      iconName: icon-gongneng
      attribute: '1152'
    name: 最远检测距离
    typeSpec:
      max: 550
      min: 150
      scale: 2
      step: 100
      type: value
      typeDefaultValue: 150
      unit: M

@make-all make-all merged commit 63f086e into make-all:main Nov 29, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants