SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
733 stars 112 forks source link

[Bug] Error when turning Wyze bulb on/off via UI "switch" #348

Closed bucketybuckbuck closed 2 years ago

bucketybuckbuck commented 2 years ago

Describe the bug Since update to 0.1.5 switches no longer work in HA for Wyze bulbs

To Reproduce Steps to reproduce the behavior:

Create UI card that uses switch.mywyzebulb Toggle Error shown at bottom of screen - "turn_off() missing 1 required positional argument: 'local_control'"

Expected behavior Bulb turns on/off

System configuration System: RPI 4 HA Version: 2022.2.7 WyzeApi Version: 0.1.5

home-assistant.log

2022-02-16 21:30:29 INFO (SyncWorker_1) [root] Sending handshake.
2022-02-16 21:30:34 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547990057168] turn_off() missing 1 required positional argument: 'local_control'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 190, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 513, in async_handle_light_off_service
    await light.async_turn_off(**filter_turn_off_params(light, params))
  File "/config/custom_components/wyzeapi/token_manager.py", line 45, in inner_function
    await func(*args, **kwargs)
  File "/config/custom_components/wyzeapi/light.py", line 144, in async_turn_off
    loop.create_task(self._bulb_service.turn_off(self._bulb))
TypeError: turn_off() missing 1 required positional argument: 'local_control'
bucketybuckbuck commented 2 years ago

image Adding screenshot