From b18aef8d317563700482baca9d5ac41670f590ea Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 15 Mar 2019 07:47:13 -0700 Subject: [PATCH] Fix test --- tests/components/mobile_app/test_entity.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/components/mobile_app/test_entity.py b/tests/components/mobile_app/test_entity.py index d8cb91a8bc6..f399f842745 100644 --- a/tests/components/mobile_app/test_entity.py +++ b/tests/components/mobile_app/test_entity.py @@ -37,11 +37,8 @@ async def test_sensor(hass, create_registrations, webhook_client): # noqa: F401 json = await reg_resp.json() assert json == {'status': 'registered'} - # 3 because we require device_tracker which adds zone.home and - # group.all_devices - assert len(hass.states.async_all()) == 3 - - entity = hass.states.async_all()[2] + entity = hass.states.get('sensor.battery_state') + assert entity is not None assert entity.attributes['device_class'] == 'battery' assert entity.attributes['icon'] == 'mdi:battery'