Teslemetry / hass-teslemetry

Teslemetry integration from Home Assistant through HACS
https://teslemetry.com
MIT License
13 stars 7 forks source link

Valet Mode switch isn't working #85

Open Snuffy2 opened 6 months ago

Snuffy2 commented 6 months ago

Checklist

Describe the issue

Turning the Valet Mode switch on/off isn't working. The error below appears every time it is switched.

Reproduction steps

  1. Turn Valet Mode on or off ...

Debug logs

VehicleSpecific.set_valet_mode() missing 1 required positional argument: 'password'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/trace.py", line 284, in async_wrapper
    await func(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 952, in _async_repeat_step
    await async_run_sequence(iteration)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 856, in async_run_sequence
    await self._async_run_script(script)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1210, in _async_run_script
    result = await self._async_run_long_action(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/teslemetry/switch.py", line 192, in async_turn_off
    await self.handle_command(self.entity_description.off_func(self.api))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/teslemetry/switch.py", line 56, in <lambda>
    off_func=lambda api: api.set_valet_mode(on=False),
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: VehicleSpecific.set_valet_mode() missing 1 required positional argument: 'password'
Bre77 commented 6 months ago

Ok I will have to remove this entity and turn it into a custom service since password is required and the Home Assistant project wont let me use the lock platform for these. Thanks for raising this issue.

Snuffy2 commented 5 months ago

Is there a different way to enable/disable Valet Mode using a service or some other process I can use?

Bre77 commented 5 months ago

Pushed an update just now with a custom service for valet mode. https://github.com/Teslemetry/hass-teslemetry/releases/tag/v1.9.12

Snuffy2 commented 5 months ago

I may be missing it, but I'm not seeing a valet mode (or set speed limit) service in HA after updating to v1.9.12. SNAG-3475

Bre77 commented 5 months ago

Yes there was an issue with the release, .13 has the services now.