mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
LLM to handle int attributes (#121037)
This commit is contained in:
parent
43481ffeac
commit
8ff4991f07
@ -483,7 +483,7 @@ def _get_exposed_entities(
|
|||||||
|
|
||||||
if attributes := {
|
if attributes := {
|
||||||
attr_name: str(attr_value)
|
attr_name: str(attr_value)
|
||||||
if isinstance(attr_value, (Enum, Decimal))
|
if isinstance(attr_value, (Enum, Decimal, int))
|
||||||
else attr_value
|
else attr_value
|
||||||
for attr_name, attr_value in state.attributes.items()
|
for attr_name, attr_value in state.attributes.items()
|
||||||
if attr_name in interesting_attributes
|
if attr_name in interesting_attributes
|
||||||
|
@ -408,7 +408,7 @@ async def test_assist_api_prompt(
|
|||||||
hass.states.async_set(
|
hass.states.async_set(
|
||||||
entry1.entity_id,
|
entry1.entity_id,
|
||||||
"on",
|
"on",
|
||||||
{"friendly_name": "Kitchen", "temperature": Decimal("0.9")},
|
{"friendly_name": "Kitchen", "temperature": Decimal("0.9"), "humidity": 65},
|
||||||
)
|
)
|
||||||
hass.states.async_set(entry2.entity_id, "on", {"friendly_name": "Living Room"})
|
hass.states.async_set(entry2.entity_id, "on", {"friendly_name": "Living Room"})
|
||||||
|
|
||||||
@ -517,9 +517,7 @@ async def test_assist_api_prompt(
|
|||||||
entry1.entity_id: {
|
entry1.entity_id: {
|
||||||
"names": "Kitchen",
|
"names": "Kitchen",
|
||||||
"state": "on",
|
"state": "on",
|
||||||
"attributes": {
|
"attributes": {"temperature": "0.9", "humidity": "65"},
|
||||||
"temperature": "0.9",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
entry2.entity_id: {
|
entry2.entity_id: {
|
||||||
"areas": "Test Area, Alternative name",
|
"areas": "Test Area, Alternative name",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user