Skip to content

Commit

Permalink
Fix Prezzibenzina doing I/O in the event loop (home-assistant#35881)
Browse files Browse the repository at this point in the history
* Fix Prezzibenzina doing I/O in the event loop

* Linting
  • Loading branch information
bachya authored and frenck committed May 24, 2020
1 parent 534fcef commit 43ec35e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions homeassistant/components/prezzibenzina/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
)


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]
Expand All @@ -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):
Expand Down Expand Up @@ -114,6 +114,6 @@ def device_state_attributes(self):
}
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]

0 comments on commit 43ec35e

Please sign in to comment.