async def async_added_to_hass(self) -> None:
        """Check, if state needs to be restored."""
        await super().async_added_to_hass()
        # if not self._data_point.is_valid:
        self._restored_state = await self.async_get_last_state()
Check, if state needs to be restored.
custom_components/homematicip_local/generic_entity.py