Skip to content

Commit

Permalink
change coroutine to callback
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate committed May 17, 2018
1 parent bde46d9 commit ae3c045
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion homeassistant/components/binary_sensor/konnected.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from homeassistant.const import (
CONF_DEVICES, CONF_TYPE, CONF_NAME, CONF_BINARY_SENSORS, ATTR_ENTITY_ID,
ATTR_STATE)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -74,7 +75,8 @@ async def async_added_to_hass(self):
self.hass, SIGNAL_SENSOR_UPDATE.format(self.entity_id),
self.async_set_state)

async def async_set_state(self, state):
@callback
def async_set_state(self, state):
"""Update the sensor's state."""
self._state = state
self.async_schedule_update_ha_state()

0 comments on commit ae3c045

Please sign in to comment.