Skip to content

Range Capability with Precision=1 - Value slider on iOS App does not honor precision #81

@joseportillodev

Description

@joseportillodev

Hi developers,

I think I've stumbled upon an issue with the Range Capability. It is related to the SinricPro iOS App (Android version not tested). I'm filing the issue here on the python-sdk repository, since my device code uses the Python SDK. Please move this where appropriate if needed.

Use case:

  • Custom device based on a device template
  • Template uses a Range capability
  • Range capability uses values from -7 to +7 with precision = 1 (I understand this means a slider with "step size = 1" on user interfaces)
Image

What was expected to happen:

  • Moving the slider cursor to any position in the range yields integer values from -7 to +7 in increments of 1. So, possible values: -7, -6, -5, ... 6, 7.
  • The python application receives signed integer values, as the callback definition states:
    • RangeValueCallback = Callable[[int, str], Awaitable[bool]]

What happens:

  • The slider lets the user move the cursor to any arbitrary position within range, leading to values from -7 to +7 but not honoring the configured precision of 1. Possible values: -7.00, -6.99, -6.98, ... 6.99, 7.00
  • The python application receives float values that are not multiple of "1.0", despite the callback parameter being declared as "int"

iOS App UI:
Image

Python application receiving that float value: FanPower = 3.97

ene 03 19:12:01 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - > platform: Python
ene 03 19:12:01 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - > SDKVersion: 5.0.1
ene 03 19:12:01 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - > User-Agent: Python/3.13 websockets/15.0.1
...
ene 03 19:12:01 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - = connection is OPEN
ene 03 19:12:01 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - < TEXT '{"timestamp":1767463921}' [24 bytes]
...
ene 03 19:15:32 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - < TEXT '{"header":{"payloadVersion":2,"signatureVersion...tJWka79+RrS6PAkd1a0="}}' [380 bytes]
ene 03 19:15:32 raspi-lasian pysinricpro[8762]: root - INFO - device_id: 6949********a61c set range value: FanPower = 3.97
ene 03 19:15:32 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - > TEXT '{"header":{"payloadVersion":2,"signatureVersion...xExatC7TfaZGHhr6u/c="}}' [394 bytes]
ene 03 19:15:38 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - < PING '' [0 bytes]
ene 03 19:15:38 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - > PONG '' [0 bytes]

What works as expedted:
In the other hand, from the Dashboard UI, the slider behaves properly, jumping to values multiple of 1:

Image

...and the Python code receiving integer values: FanPower = 5

ene 03 19:36:46 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - < TEXT '{"header":{"payloadVersion":2,"signatureVersion...jIxfBzq8/AU+Xj1m3fE="}}' [373 bytes]
ene 03 19:36:46 raspi-lasian pysinricpro[8762]: root - INFO - device_id: 6949********a61c set range value: FanPower = 5
ene 03 19:36:46 raspi-lasian pysinricpro[8762]: websockets.client - DEBUG - > TEXT '{"header":{"payloadVersion":2,"signatureVersion...QIhOGNwE539k4Pxqzy4="}}' [387 bytes]

Maybe I'm missing something from the docu. Does range "precision" equal "step size" in range sliders?
Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions