mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 21:55:10 +02:00
Use callback instead of async
This commit is contained in:
@@ -50,9 +50,10 @@ RESPONSE_SCHEMA = vol.Schema(
|
||||
|
||||
|
||||
class Updater:
|
||||
"""Updater class."""
|
||||
"""Updater class for data exchange."""
|
||||
|
||||
def __init__(self, update_available: bool, newest_version: str, release_notes: str):
|
||||
"""Updater constructor."""
|
||||
self.update_available = update_available
|
||||
self.release_notes = release_notes
|
||||
self.newest_version = newest_version
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""Support for Home Assistant Updater binary sensors."""
|
||||
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
@@ -58,7 +59,8 @@ class UpdaterBinary(BinarySensorDevice):
|
||||
data[ATTR_NEWEST_VERSION] = self._newest_version
|
||||
return data
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
@callback
|
||||
def async_added_to_hass(self):
|
||||
"""Register update dispatcher."""
|
||||
|
||||
async def async_state_update(updater: Updater):
|
||||
|
Reference in New Issue
Block a user