async def async_added_to_hass(self):
    'Call when entity is added to hass.'
    self.hass.async_add_job(self._device.add_message_listener, self.on_message)
Call when entity is added to hass.
async def async_added_to_hass(self):
    
    self.hass.async_add_job(self._device.add_message_listener, self.on_message)