Use generators for async_add_entities in Anthemav (#76587)

pull/72626/head^2
Robert Hillis 2022-08-28 17:40:53 -04:00 committed by GitHub
parent bf510fcb4c
commit 7be6d6eba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 9 deletions

View File

@ -91,17 +91,14 @@ async def async_setup_entry(
avr: Connection = hass.data[DOMAIN][config_entry.entry_id]
entities = []
for zone_number in avr.protocol.zones:
_LOGGER.debug("Initializing Zone %s", zone_number)
entity = AnthemAVR(
avr.protocol, name, mac_address, model, zone_number, config_entry.entry_id
)
entities.append(entity)
_LOGGER.debug("Connection data dump: %s", avr.dump_conndata)
async_add_entities(entities)
async_add_entities(
AnthemAVR(
avr.protocol, name, mac_address, model, zone_number, config_entry.entry_id
)
for zone_number in avr.protocol.zones
)
class AnthemAVR(MediaPlayerEntity):