Skip to content

Commit

Permalink
Fix adding entities
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed May 27, 2024
1 parent 09f4649 commit 0d65164
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions custom_components/onkyo/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import Any

import voluptuous as vol

from homeassistant.components.media_player import (
MediaPlayerEntity,
MediaPlayerEntityFeature,
Expand Down Expand Up @@ -68,13 +67,13 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Onkyo entry."""
entities = []
coordinator = entry.runtime_data
for k, v in coordinator.data.items():
if k == "main":
entities.append(OnkyoDevice(coordinator, k))
else:
entities.append(OnkyoDeviceZone(coordinator, k))
entities = [
OnkyoDevice(coordinator, key)
if key == "main"
else OnkyoDeviceZone(coordinator, key)
for key in coordinator.data
]

async def async_service_handler(service: ServiceCall) -> None:
"""Handle for services."""
Expand Down

0 comments on commit 0d65164

Please sign in to comment.