sensor/zigate.py
async def async_added_to_hass(self):
        """Handle entity which will be added."""

        await super().async_added_to_hass()
        state = await self.async_get_last_state()
        if state:
            for attr in iter(state.attributes):
                if attr != ATTR_FRIENDLY_NAME:
                    _LOGGER.info('{}: set attribute {} from last state: {}'.format(self._name, attr, state.attributes[attr]))
                    self.update_attributes(attr, state.attributes[attr])
Handle entity which will be added.
Handle entity which will be added.
Handle entity which will be added .
async def async_added_to_hass(self):
        await super().async_added_to_hass()
        state = await self.async_get_last_state()
        if state:
            for attr in iter(state.attributes):
                if attr != ATTR_FRIENDLY_NAME:
                    _LOGGER.info('{}: set attribute {} from last state: {}'.format(self._name, attr, state.attributes[attr]))
                    self.update_attributes(attr, state.attributes[attr])
async def async_added_to_hass ( self ) : await super ( ) . async_added_to_hass ( ) state = await self . async_get_last_state ( ) if state : for attr in iter ( state . attributes ) : if attr != ATTR_FRIENDLY_NAME : _LOGGER . info ( '{}: set attribute {} from last state: {}' . format ( self . _name , attr , state . attributes [ attr ] ) ) self . update_attributes ( attr , state . attributes [ attr ] )
Handle entity which will be added.
Handle entity which will be added .
"""Handle entity which will be added."""
self