diff --git a/tests/test_standalone_setup.py b/tests/test_standalone_setup.py index fba19e5..cb5aa95 100644 --- a/tests/test_standalone_setup.py +++ b/tests/test_standalone_setup.py @@ -600,14 +600,16 @@ class TestAppNameMapResolution: assert player.app_name == "com.google.android.youtube.tv" - async def test_entity_tier_still_wins(self): + async def test_entity_tier_serves_when_no_higher_tier_matches(self): + """P5-1: the entity tier is below map/manifest — it serves when the + package has no explicit override and no manifest label yet.""" from types import SimpleNamespace as SimpleNS import entity_stublib modules = entity_stublib.load_entity_modules() player, _s, _i = _cmd_player(modules) - player._entry.options["app_name_map"] = {"ar.tvplayer.tv": "TiviMate"} + player._entry.options["app_name_map"] = {} # no override player._androidtv_entity = "media_player.atv" state = SimpleNS(attributes={"app_id": "ar.tvplayer.tv", "app_name": "ATV Tivi"}) player.hass = SimpleNS(states=SimpleNS(get=lambda eid: state)) @@ -616,4 +618,5 @@ class TestAppNameMapResolution: player._manager._on_current_app("ar.tvplayer.tv") await asyncio.sleep(0.05) - assert player.app_name == "ATV Tivi" # entity tier, map untouched + # no cached label yet → falls through to the entity tier + assert player.app_name == "ATV Tivi"