mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
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:
parent
1593bdf2e9
commit
19573a9cbe
@ -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."""
|
||||
|
||||
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):
|
||||
@ -114,6 +114,6 @@ class PrezziBenzinaSensor(Entity):
|
||||
}
|
||||
return attrs
|
||||
|
||||
async def async_update(self):
|
||||
def update(self):
|
||||
"""Get the latest data and updates the states."""
|
||||
self._data = self._client.get_by_id(self._station)[self._index]
|
||||
|
Loading…
x
Reference in New Issue
Block a user