mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Fix doorbird with externally added events (#123313)
This commit is contained in:
parent
2144a9a7b2
commit
135c80186f
@ -195,7 +195,7 @@ class ConfiguredDoorBird:
|
||||
title: str | None = data.get("title")
|
||||
if not title or not title.startswith("Home Assistant"):
|
||||
continue
|
||||
event = title.split("(")[1].strip(")")
|
||||
event = title.partition("(")[2].strip(")")
|
||||
if input_type := favorite_input_type.get(identifier):
|
||||
events.append(DoorbirdEvent(event, input_type))
|
||||
elif input_type := default_event_types.get(event):
|
||||
|
@ -7,6 +7,10 @@
|
||||
"1": {
|
||||
"title": "Home Assistant (mydoorbird_motion)",
|
||||
"value": "http://127.0.0.1:8123/api/doorbird/mydoorbird_motion?token=01J2F4B97Y7P1SARXEJ6W07EKD"
|
||||
},
|
||||
"2": {
|
||||
"title": "externally added event",
|
||||
"value": "http://127.0.0.1/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,4 +49,4 @@ async def test_reset_favorites_button(
|
||||
DOMAIN, SERVICE_PRESS, {ATTR_ENTITY_ID: reset_entity_id}, blocking=True
|
||||
)
|
||||
assert hass.states.get(reset_entity_id).state != STATE_UNKNOWN
|
||||
assert doorbird_entry.api.delete_favorite.call_count == 2
|
||||
assert doorbird_entry.api.delete_favorite.call_count == 3
|
||||
|
Loading…
x
Reference in New Issue
Block a user