async def METHOD_NAME(
    self,
    mode: str,
    temp: float | None = None,
    end_time: int | None = None,
) -> bool:
    json_therm_set: dict[str, Any] = {
        "rooms": [
            {
                "id": self.entity_id,
                "therm_setpoint_mode": mode,
            },
        ],
    }
    if temp:
        json_therm_set["rooms"][0]["therm_setpoint_temperature"] = temp
    if end_time:
        json_therm_set["rooms"][0]["therm_setpoint_end_time"] = end_time
    return await self.home.async_set_state(json_therm_set)