Fix callback and async (#31281)
* Fix callback and async * Fix a return * Fix test * Fix mqtt tests * Fix some more callbacks
This commit is contained in:
parent
ee602e40a6
commit
e9e44dbd97
90 changed files with 627 additions and 883 deletions
|
@ -4,6 +4,7 @@ import logging
|
|||
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY
|
||||
from homeassistant.core import callback
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -81,6 +82,7 @@ class MyStromBinarySensor(BinarySensorDevice):
|
|||
"""Return true if the binary sensor is on."""
|
||||
return self._state
|
||||
|
||||
@callback
|
||||
def async_on_update(self, value):
|
||||
"""Receive an update."""
|
||||
self._state = value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue