mirror of
https://github.com/home-assistant/core.git
synced 2025-06-25 01:21:51 +02:00
Address comments
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
"services": {
|
||||
"generate_data": {
|
||||
"name": "Generate data",
|
||||
"description": "Use AI to run a task that generates data.",
|
||||
"description": "Uses AI to run a task that generates data.",
|
||||
"fields": {
|
||||
"task_name": {
|
||||
"name": "Task name",
|
||||
|
@ -70,5 +70,6 @@ class GenDataTaskResult:
|
||||
def as_dict(self) -> dict[str, Any]:
|
||||
"""Return result as a dict."""
|
||||
return {
|
||||
"conversation_id": self.conversation_id,
|
||||
"data": self.data,
|
||||
}
|
||||
|
@ -71,6 +71,9 @@ async def test_run_task_preferred_entity(
|
||||
instructions="Test prompt",
|
||||
)
|
||||
assert result.data == "Mock result"
|
||||
as_dict = result.as_dict()
|
||||
assert as_dict["conversation_id"] == result.conversation_id
|
||||
assert as_dict["data"] == "Mock result"
|
||||
state = hass.states.get(TEST_ENTITY_ID)
|
||||
assert state is not None
|
||||
assert state.state != STATE_UNKNOWN
|
||||
|
Reference in New Issue
Block a user