Julius2342 / pyvlx

PyVLX - controling VELUX windows with Python via KLF 200
GNU Lesser General Public License v3.0
74 stars 26 forks source link

Stop cover command throws an error #355

Closed pawlizio closed 8 months ago

pawlizio commented 8 months ago

I have problems with changes introduced with #338

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/velux/cover.py", line 285, in async_stop_cover
    await self.node.stop(wait_for_completion=False)
  File "/usr/local/lib/python3.11/site-packages/pyvlx/opening_device.py", line 404, in stop
    await self.set_position_and_orientation(
  File "/usr/local/lib/python3.11/site-packages/pyvlx/opening_device.py", line 307, in set_position_and_orientation
    self.target_position = TargetPosition.from_position(position)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyvlx/parameter.py", line 277, in from_position
    target.position_percent = from_position.position_percent
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyvlx/parameter.py", line 240, in position_percent
    self.raw = self.from_percent(percent=position_percent)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyvlx/parameter.py", line 91, in from_percent
    raise PyVLXException("Position::percent_out_of_range")
pyvlx.exception.PyVLXException: <PyVLXException description="Position::percent_out_of_range" />