Exemple #1
0
    async def climate_command(
        self,
        key: int,
        mode: Optional[ClimateMode] = None,
        target_temperature: Optional[float] = None,
        target_temperature_low: Optional[float] = None,
        target_temperature_high: Optional[float] = None,
        away: Optional[bool] = None,
    ) -> None:
        self._check_authenticated()

        req = pb.ClimateCommandRequest()
        req.key = key
        if mode is not None:
            req.has_mode = True
            req.mode = mode
        if target_temperature is not None:
            req.has_target_temperature = True
            req.target_temperature = target_temperature
        if target_temperature_low is not None:
            req.has_target_temperature_low = True
            req.target_temperature_low = target_temperature_low
        if target_temperature_high is not None:
            req.has_target_temperature_high = True
            req.target_temperature_high = target_temperature_high
        if away is not None:
            req.has_away = True
            req.away = away
        await self._connection.send_message(req)
Exemple #2
0
    async def climate_command(
        self,
        key: int,
        mode: Optional[ClimateMode] = None,
        target_temperature: Optional[float] = None,
        target_temperature_low: Optional[float] = None,
        target_temperature_high: Optional[float] = None,
        away: Optional[bool] = None,
        boost: Optional[bool] = None,
        sleep_: Optional[bool] = None,
        eco: Optional[bool] = None,
        fan_mode: Optional[ClimateFanMode] = None,
        swing_mode: Optional[ClimateSwingMode] = None,
    ) -> None:
        self._check_authenticated()

        req = pb.ClimateCommandRequest()
        req.key = key
        if mode is not None:
            req.has_mode = True
            req.mode = mode
        if target_temperature is not None:
            req.has_target_temperature = True
            req.target_temperature = target_temperature
        if target_temperature_low is not None:
            req.has_target_temperature_low = True
            req.target_temperature_low = target_temperature_low
        if target_temperature_high is not None:
            req.has_target_temperature_high = True
            req.target_temperature_high = target_temperature_high
        if away is not None:
            req.has_away = True
            req.away = away
        if boost is not None:
            req.has_boost = True
            req.boost = boost
        if eco is not None:
            req.has_eco = True
            req.eco = eco
        if sleep_ is not None:
            req.has_sleep_ = True
            req.sleep_ = sleep_
        if fan_mode is not None:
            req.has_fan_mode = True
            req.fan_mode = fan_mode
        if swing_mode is not None:
            req.has_swing_mode = True
            req.swing_mode = swing_mode
        await self._connection.send_message(req)