Fix Prezzibenzina doing I/O in the event loop (#35881)

* Fix Prezzibenzina doing I/O in the event loop

* Linting
This commit is contained in:
Aaron Bach 2020-05-20 16:09:00 -06:00 committed by GitHub
parent 1593bdf2e9
commit 19573a9cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
) )
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the PrezziBenzina sensor platform.""" """Set up the PrezziBenzina sensor platform."""
station = config[CONF_STATION] station = config[CONF_STATION]
@ -65,7 +65,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
) )
) )
async_add_entities(dev, True) add_entities(dev, True)
class PrezziBenzinaSensor(Entity): class PrezziBenzinaSensor(Entity):
@ -114,6 +114,6 @@ class PrezziBenzinaSensor(Entity):
} }
return attrs return attrs
async def async_update(self): def update(self):
"""Get the latest data and updates the states.""" """Get the latest data and updates the states."""
self._data = self._client.get_by_id(self._station)[self._index] self._data = self._client.get_by_id(self._station)[self._index]