diff --git a/homeassistant/components/motion_blinds/cover.py b/homeassistant/components/motion_blinds/cover.py index 06c1f1d2735..2b42c1be666 100644 --- a/homeassistant/components/motion_blinds/cover.py +++ b/homeassistant/components/motion_blinds/cover.py @@ -16,7 +16,6 @@ from homeassistant.components.cover import ( CoverEntity, ) from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, ENTITY_MATCH_NONE -from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.update_coordinator import CoordinatorEntity @@ -170,14 +169,9 @@ class MotionPositionDevice(CoordinatorEntity, CoverEntity): """Return if the cover is closed or not.""" return self._blind.position == 100 - @callback - def _push_callback(self): - """Update entity state when a push has been received.""" - self.schedule_update_ha_state(force_refresh=False) - async def async_added_to_hass(self): """Subscribe to multicast pushes and register signal handler.""" - self._blind.Register_callback(self.unique_id, self._push_callback) + self._blind.Register_callback(self.unique_id, self.schedule_update_ha_state) self.async_on_remove( async_dispatcher_connect(self.hass, DOMAIN, self.signal_handler) ) diff --git a/homeassistant/components/motion_blinds/sensor.py b/homeassistant/components/motion_blinds/sensor.py index 0c31ca070cf..dd637696e77 100644 --- a/homeassistant/components/motion_blinds/sensor.py +++ b/homeassistant/components/motion_blinds/sensor.py @@ -9,7 +9,6 @@ from homeassistant.const import ( PERCENTAGE, SIGNAL_STRENGTH_DECIBELS_MILLIWATT, ) -from homeassistant.core import callback from homeassistant.helpers.entity import Entity from homeassistant.helpers.update_coordinator import CoordinatorEntity @@ -97,14 +96,9 @@ class MotionBatterySensor(CoordinatorEntity, Entity): """Return device specific state attributes.""" return {ATTR_BATTERY_VOLTAGE: self._blind.battery_voltage} - @callback - def push_callback(self): - """Update entity state when a push has been received.""" - self.schedule_update_ha_state(force_refresh=False) - async def async_added_to_hass(self): """Subscribe to multicast pushes.""" - self._blind.Register_callback(self.unique_id, self.push_callback) + self._blind.Register_callback(self.unique_id, self.schedule_update_ha_state) await super().async_added_to_hass() async def async_will_remove_from_hass(self): @@ -206,14 +200,9 @@ class MotionSignalStrengthSensor(CoordinatorEntity, Entity): """Return the state of the sensor.""" return self._device.RSSI - @callback - def push_callback(self): - """Update entity state when a push has been received.""" - self.schedule_update_ha_state(force_refresh=False) - async def async_added_to_hass(self): """Subscribe to multicast pushes.""" - self._device.Register_callback(self.unique_id, self.push_callback) + self._device.Register_callback(self.unique_id, self.schedule_update_ha_state) await super().async_added_to_hass() async def async_will_remove_from_hass(self):