def is_restored(self) -> bool:
        """Return if the state is restored."""
        return (
            not self._data_point.is_valid
            and self._restored_state is not None
            and self._restored_state.state is not None
        )
Return if the state is restored.
custom_components/homematicip_local/generic_entity.py