add_entities -> async_add_entities (#19943)

Better state handling at HA startup
This commit is contained in:
SNoof85 2019-01-11 02:13:29 +01:00 committed by Paulus Schoutsen
parent 4d187e08d4
commit 96d20a64d5

View file

@ -15,13 +15,13 @@ _LOGGER = logging.getLogger(__name__)
async def async_setup_platform( async def async_setup_platform(
hass, config, add_entities, discovery_info=None): hass, config, async_add_entities, discovery_info=None):
"""Set up the sensors.""" """Set up the sensors."""
fbx = hass.data[DATA_FREEBOX] fbx = hass.data[DATA_FREEBOX]
add_entities([ async_add_entities([
FbxRXSensor(fbx), FbxRXSensor(fbx),
FbxTXSensor(fbx) FbxTXSensor(fbx)
]) ], True)
class FbxSensor(Entity): class FbxSensor(Entity):