def extra_state_attributes(self) -> dict[str, Any]:
        """Return the state attributes of the generic entity."""
        attributes: dict[str, Any] = {}
        attributes.update(self._static_state_attributes)
        attributes.update(self._data_point.additional_information)

        if (
            isinstance(self._data_point, CalculatedDataPoint | GenericDataPoint) and self._data_point.is_readable
        ) or isinstance(self._data_point, CustomDataPoint):
            if self._data_point.is_valid:
                attributes[ATTR_VALUE_STATE] = (
                    HmEntityState.UNCERTAIN if self._data_point.state_uncertain else HmEntityState.VALID
                )
            else:
                attributes[ATTR_VALUE_STATE] = HmEntityState.NOT_VALID
        return attributes
Return the state attributes of the generic entity.
custom_components/homematicip_local/generic_entity.py