mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Fix run errors in Tessie (#106521)
This commit is contained in:
parent
5b706cedeb
commit
fb893a5315
@ -52,7 +52,7 @@ class TessieEntity(CoordinatorEntity[TessieStateUpdateCoordinator]):
|
|||||||
return self.coordinator.data.get(key or self.key, default)
|
return self.coordinator.data.get(key or self.key, default)
|
||||||
|
|
||||||
async def run(
|
async def run(
|
||||||
self, func: Callable[..., Awaitable[dict[str, bool]]], **kargs: Any
|
self, func: Callable[..., Awaitable[dict[str, bool | str]]], **kargs: Any
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Run a tessie_api function and handle exceptions."""
|
"""Run a tessie_api function and handle exceptions."""
|
||||||
try:
|
try:
|
||||||
@ -66,7 +66,7 @@ class TessieEntity(CoordinatorEntity[TessieStateUpdateCoordinator]):
|
|||||||
raise HomeAssistantError from e
|
raise HomeAssistantError from e
|
||||||
if response["result"] is False:
|
if response["result"] is False:
|
||||||
raise HomeAssistantError(
|
raise HomeAssistantError(
|
||||||
response.get("reason"), "An unknown issue occurred"
|
response.get("reason", "An unknown issue occurred")
|
||||||
)
|
)
|
||||||
|
|
||||||
def set(self, *args: Any) -> None:
|
def set(self, *args: Any) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user