def extra_restore_state_data(self):
        """Return entity specific state data to be restored."""
        return RestoredExtraData({
            'state': self.native_value,
            'attrs': self._attr_extra_state_attributes,
        })
Return entity specific state data to be restored.
custom_components/xiaomi_miot/sensor.py