def METHOD_NAME(self, topic: str, payload: Any, retain: bool = False) -> None:
    """Wrapper for publishing when client is in valid state."""
    if not self.connected:
        logger.error(f"Unable to publish to {topic}: client is not connected")
        return
    self.client.METHOD_NAME(
        f"{self.mqtt_config.topic_prefix}/{topic}", payload, retain=retain
    )