Use assignment expressions 28 (#58189)
This commit is contained in:
parent
a3d1159a13
commit
eab235173b
24 changed files with 30 additions and 61 deletions
|
@ -154,8 +154,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
|
||||
@callback
|
||||
def async_add_service(service):
|
||||
entity_class = ENTITY_TYPES.get(service.short_type)
|
||||
if not entity_class:
|
||||
if not (entity_class := ENTITY_TYPES.get(service.short_type)):
|
||||
return False
|
||||
info = {"aid": service.accessory.aid, "iid": service.iid}
|
||||
async_add_entities([entity_class(conn, info)], True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue