How to use the aioesphomeapi.api_pb2.CoverCommandRequest function in aioesphomeapi

To help you get started, we’ve selected a few aioesphomeapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esphome / aioesphomeapi / aioesphomeapi / core.py View on Github external
15: pb.ListEntitiesLightResponse,
    16: pb.ListEntitiesSensorResponse,
    17: pb.ListEntitiesSwitchResponse,
    18: pb.ListEntitiesTextSensorResponse,
    19: pb.ListEntitiesDoneResponse,
    20: pb.SubscribeStatesRequest,
    21: pb.BinarySensorStateResponse,
    22: pb.CoverStateResponse,
    23: pb.FanStateResponse,
    24: pb.LightStateResponse,
    25: pb.SensorStateResponse,
    26: pb.SwitchStateResponse,
    27: pb.TextSensorStateResponse,
    28: pb.SubscribeLogsRequest,
    29: pb.SubscribeLogsResponse,
    30: pb.CoverCommandRequest,
    31: pb.FanCommandRequest,
    32: pb.LightCommandRequest,
    33: pb.SwitchCommandRequest,
    34: pb.SubscribeHomeassistantServicesRequest,
    35: pb.HomeassistantServiceResponse,
    36: pb.GetTimeRequest,
    37: pb.GetTimeResponse,
    38: pb.SubscribeHomeAssistantStatesRequest,
    39: pb.SubscribeHomeAssistantStateResponse,
    40: pb.HomeAssistantStateResponse,
    41: pb.ListEntitiesServicesResponse,
    42: pb.ExecuteServiceRequest,
    43: pb.ListEntitiesCameraResponse,
    44: pb.CameraImageResponse,
    45: pb.CameraImageRequest,
    46: pb.ListEntitiesClimateResponse,
github esphome / aioesphomeapi / aioesphomeapi / client.py View on Github external
async def cover_command(self,
                            key: int,
                            position: Optional[float] = None,
                            tilt: Optional[float] = None,
                            stop: bool = False,
                            ) -> None:
        self._check_authenticated()

        req = pb.CoverCommandRequest()
        req.key = key
        if self.api_version >= APIVersion(1, 1):
            if position is not None:
                req.has_position = True
                req.position = position
            if tilt is not None:
                req.has_tilt = True
                req.tilt = tilt
            if stop:
                req.stop = stop
        else:
            req.has_legacy_command = True
            if stop:
                req.legacy_command = LegacyCoverCommand.STOP
            elif position == 1.0:
                req.legacy_command = LegacyCoverCommand.OPEN