nergal / homeassistant-vacuum-viomi

Integration of a Xiaomi Viomi vacuum to a Home Assistant
MIT License
54 stars 14 forks source link

Change fan state throws 'int' object has no attribute 'value' #3

Closed nergal closed 2 years ago

nergal commented 2 years ago

On change fan mode through UI

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 760, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
    await result
  File "/config/custom_components/xiaomi_viomi/vacuum.py", line 306, in async_set_fan_speed
    await self._try_command(
  File "/config/custom_components/xiaomi_viomi/vacuum.py", line 267, in _try_command
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/viomivacuum.py", line 667, in set_fan_speed
    self.send("set_suction", [speed.value])
AttributeError: 'int' object has no attribute 'value'
nergal commented 2 years ago

Done