Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.7.4: homeassistant.exceptions.HomeAssistantError: Could not wake up vehicle #45

Closed
3 tasks done
purcell-lab opened this issue Mar 15, 2024 · 1 comment
Closed
3 tasks done

Comments

@purcell-lab
Copy link
Contributor

Checklist

  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Inability to wake up the vehicle could be handled as a Warning, as it is generally a transient condition.

It is currently handled as a HomeAssistantError.
image

Reproduction steps

No response

Debug logs

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 5:22:17 PM (1 occurrences)
Last logged: 5:22:17 PM

[281471908809152] Could not wake up vehicle
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 111, in async_set_value
    await entity.async_set_native_value(native_value)
  File "/config/custom_components/teslemetry/number.py", line 190, in async_set_native_value
    await self.wake_up_if_asleep()
  File "/config/custom_components/teslemetry/entity.py", line 218, in wake_up_if_asleep
    raise HomeAssistantError("Could not wake up vehicle")
homeassistant.exceptions.HomeAssistantError: Could not wake up vehicle
@Bre77
Copy link
Contributor

Bre77 commented Mar 16, 2024

I dont believe Home Assistant has a way to raise warnings, only logging them. However this is a service failure since the service call did not run, so I think error is appropriate.

Essentially if I raised a warning, Home Assistant would believe the service call was successful even when it isnt.

@Bre77 Bre77 closed this as completed Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants