INNER CODE UNIT · Python
setup_area_aware_media_player
jseidl/magic-areas · custom_components/magic_areas/media_player/__init__.py:69
def setup_area_aware_media_player(area):
"""Create Area-aware media player."""
ma_data = area.hass.data[MODULE_DATA]
# Check if we have areas with MEDIA_PLAYER_DOMAIN entities
areas_with_media_players = []
for entry in ma_data.values():
current_area = entry[DATA_AREA_OBJECT]
# Skip meta areas
if current_area.is_meta():
_LOGGER.debug("%s: Is meta-area, skipping.", current_area.name)
continue
# Skip areas with feature not enabled
if not current_area.has_feature(CONF_FEATURE_AREA_AWARE_MEDIA_PLAYER):
_LOGGER.debug(