Add device name to sensor name for mobile_app (#31756)

* Add device name to sensor name

* Update test to include device name
This commit is contained in:
Daniel Shokouhi authored and GitHub committed 2020-02-12 11:40:39 -08:00
1 parent 3b3e062a35
commit 43256ebd83
2 files changed
+6 -4

No files matched your search

+3 -3
View File
@@ -35,7 +35,7 @@ async def test_sensor(hass, create_registrations, webhook_client):
assert json == {"success": True}
await hass.async_block_till_done()
entity = hass.states.get("sensor.battery_state")
entity = hass.states.get("sensor.test_1_battery_state")
assert entity is not None
assert entity.attributes["device_class"] == "battery"
@@ -43,7 +43,7 @@ async def test_sensor(hass, create_registrations, webhook_client):
assert entity.attributes["unit_of_measurement"] == "%"
assert entity.attributes["foo"] == "bar"
assert entity.domain == "sensor"
assert entity.name == "Battery State"
assert entity.name == "Test 1 Battery State"
assert entity.state == "100"
update_resp = await webhook_client.post(
@@ -63,7 +63,7 @@ async def test_sensor(hass, create_registrations, webhook_client):
assert update_resp.status == 200
updated_entity = hass.states.get("sensor.battery_state")
updated_entity = hass.states.get("sensor.test_1_battery_state")
assert updated_entity.state == "123"
dev_reg = await device_registry.async_get_registry(hass)