Skip to content

Commit

Permalink
fix(sentence): fix sentence issue in HA 2024.10.x
Browse files Browse the repository at this point in the history
* Update sentence.py

fix #301

* make backwards compatible
  • Loading branch information
andreasbrett authored Sep 26, 2024
1 parent 0bc4230 commit 8114e1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/nodered/sentence.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from hassil.recognize import RecognizeResult
from homeassistant.components.conversation.default_agent import (
DATA_DEFAULT_ENTITY,
DefaultAgent,
async_get_default_agent,
)
from homeassistant.components.websocket_api import (
async_response,
Expand Down Expand Up @@ -121,7 +121,7 @@ async def _remove_future() -> None:
_LOGGER.info(f"Sentence trigger removed: {sentences}")

try:
default_agent = async_get_default_agent(hass)
default_agent = hass.data[DATA_DEFAULT_ENTITY]
assert isinstance(default_agent, DefaultAgent)

_remove_trigger = default_agent.register_trigger(sentences, handle_trigger)
Expand Down

0 comments on commit 8114e1b

Please sign in to comment.