mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Add above and below to sensor trigger extra_fields (#27160)
This commit is contained in:
parent
bb45bdd8dd
commit
9902209ad2
@ -140,6 +140,10 @@ async def async_get_trigger_capabilities(hass, trigger):
|
||||
"""List trigger capabilities."""
|
||||
return {
|
||||
"extra_fields": vol.Schema(
|
||||
{vol.Optional(CONF_FOR): cv.positive_time_period_dict}
|
||||
{
|
||||
vol.Optional(CONF_ABOVE): vol.Coerce(float),
|
||||
vol.Optional(CONF_BELOW): vol.Coerce(float),
|
||||
vol.Optional(CONF_FOR): cv.positive_time_period_dict,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -86,7 +86,9 @@ async def test_get_trigger_capabilities(hass, device_reg, entity_reg):
|
||||
entity_reg.async_get_or_create(DOMAIN, "test", "5678", device_id=device_entry.id)
|
||||
expected_capabilities = {
|
||||
"extra_fields": [
|
||||
{"name": "for", "optional": True, "type": "positive_time_period_dict"}
|
||||
{"name": "above", "optional": True, "type": "float"},
|
||||
{"name": "below", "optional": True, "type": "float"},
|
||||
{"name": "for", "optional": True, "type": "positive_time_period_dict"},
|
||||
]
|
||||
}
|
||||
triggers = await async_get_device_automations(hass, "trigger", device_entry.id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user