Use assignment expressions 26 (#58187)
This commit is contained in:
parent
be201e3ebe
commit
184e0d7fdf
15 changed files with 29 additions and 57 deletions
|
@ -264,9 +264,7 @@ async def webhook_fire_event(hass, config_entry, data):
|
|||
@validate_schema({vol.Required(ATTR_CAMERA_ENTITY_ID): cv.string})
|
||||
async def webhook_stream_camera(hass, config_entry, data):
|
||||
"""Handle a request to HLS-stream a camera."""
|
||||
camera = hass.states.get(data[ATTR_CAMERA_ENTITY_ID])
|
||||
|
||||
if camera is None:
|
||||
if (camera := hass.states.get(data[ATTR_CAMERA_ENTITY_ID])) is None:
|
||||
return webhook_response(
|
||||
{"success": False},
|
||||
registration=config_entry.data,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue