async def async_added_to_hass(self):
    'Restore RFXtrx device state (ON/OFF).'
    (await super().async_added_to_hass())
    if (self._event is None):
        old_state = (await self.async_get_last_state())
        if (old_state is not None):
            self._state = (old_state.state == STATE_ON)
            self._brightness = old_state.attributes.get(ATTR_BRIGHTNESS)
Restore RFXtrx device state (ON/OFF).
async def async_added_to_hass(self):
    
    (await super().async_added_to_hass())
    if (self._event is None):
        old_state = (await self.async_get_last_state())
        if (old_state is not None):
            self._state = (old_state.state == STATE_ON)
            self._brightness = old_state.attributes.get(ATTR_BRIGHTNESS)