Clean up async_update_entity helper usage (#68641)
This commit is contained in:
parent
53245c6523
commit
d645e80ccd
23 changed files with 87 additions and 103 deletions
|
@ -10,6 +10,7 @@ from homeassistant.const import (
|
|||
STATE_UNAVAILABLE,
|
||||
STATE_UNKNOWN,
|
||||
)
|
||||
from homeassistant.helpers.entity_component import async_update_entity
|
||||
|
||||
from tests.components.dexcom import GLUCOSE_READING, init_integration
|
||||
|
||||
|
@ -36,12 +37,8 @@ async def test_sensors_unknown(hass):
|
|||
"homeassistant.components.dexcom.Dexcom.get_current_glucose_reading",
|
||||
return_value=None,
|
||||
):
|
||||
await hass.helpers.entity_component.async_update_entity(
|
||||
"sensor.dexcom_test_username_glucose_value"
|
||||
)
|
||||
await hass.helpers.entity_component.async_update_entity(
|
||||
"sensor.dexcom_test_username_glucose_trend"
|
||||
)
|
||||
await async_update_entity(hass, "sensor.dexcom_test_username_glucose_value")
|
||||
await async_update_entity(hass, "sensor.dexcom_test_username_glucose_trend")
|
||||
|
||||
test_username_glucose_value = hass.states.get(
|
||||
"sensor.dexcom_test_username_glucose_value"
|
||||
|
@ -61,12 +58,8 @@ async def test_sensors_update_failed(hass):
|
|||
"homeassistant.components.dexcom.Dexcom.get_current_glucose_reading",
|
||||
side_effect=SessionError,
|
||||
):
|
||||
await hass.helpers.entity_component.async_update_entity(
|
||||
"sensor.dexcom_test_username_glucose_value"
|
||||
)
|
||||
await hass.helpers.entity_component.async_update_entity(
|
||||
"sensor.dexcom_test_username_glucose_trend"
|
||||
)
|
||||
await async_update_entity(hass, "sensor.dexcom_test_username_glucose_value")
|
||||
await async_update_entity(hass, "sensor.dexcom_test_username_glucose_trend")
|
||||
|
||||
test_username_glucose_value = hass.states.get(
|
||||
"sensor.dexcom_test_username_glucose_value"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue