Пример #1
0
 def info_response(door_status: DoorStatus) -> GogoGate2InfoResponse:
     return GogoGate2InfoResponse(
         user="******",
         gogogatename="gogogatename0",
         model="",
         apiversion="",
         remoteaccessenabled=False,
         remoteaccess="abc123.blah.blah",
         firmwareversion="",
         apicode="",
         door1=GogoGate2Door(
             door_id=1,
             permission=True,
             name="Door1",
             gate=False,
             mode=DoorMode.GARAGE,
             status=door_status,
             sensor=True,
             sensorid=None,
             camera=False,
             events=2,
             temperature=None,
             voltage=40,
         ),
         door2=GogoGate2Door(
             door_id=2,
             permission=True,
             name=None,
             gate=True,
             mode=DoorMode.GARAGE,
             status=DoorStatus.UNDEFINED,
             sensor=True,
             sensorid=None,
             camera=False,
             events=0,
             temperature=None,
             voltage=40,
         ),
         door3=GogoGate2Door(
             door_id=3,
             permission=True,
             name=None,
             gate=False,
             mode=DoorMode.GARAGE,
             status=DoorStatus.UNDEFINED,
             sensor=True,
             sensorid=None,
             camera=False,
             events=0,
             temperature=None,
             voltage=40,
         ),
         outputs=Outputs(output1=True, output2=False, output3=True),
         network=Network(ip=""),
         wifi=Wifi(SSID="", linkquality="", signal=""),
     )
Пример #2
0
def _mocked_gogogate_sensor_response(battery_level: int, temperature: float):
    return GogoGate2InfoResponse(
        user="******",
        gogogatename="gogogatename0",
        model="",
        apiversion="",
        remoteaccessenabled=False,
        remoteaccess="abc123.blah.blah",
        firmwareversion="",
        apicode="",
        door1=GogoGate2Door(
            door_id=1,
            permission=True,
            name="Door1",
            gate=False,
            mode=DoorMode.GARAGE,
            status=DoorStatus.OPENED,
            sensor=True,
            sensorid="ABCD",
            camera=False,
            events=2,
            temperature=temperature,
            voltage=battery_level,
        ),
        door2=GogoGate2Door(
            door_id=2,
            permission=True,
            name="Door2",
            gate=True,
            mode=DoorMode.GARAGE,
            status=DoorStatus.UNDEFINED,
            sensor=True,
            sensorid="WIRE",
            camera=False,
            events=0,
            temperature=temperature,
            voltage=battery_level,
        ),
        door3=GogoGate2Door(
            door_id=3,
            permission=True,
            name="Door3",
            gate=False,
            mode=DoorMode.GARAGE,
            status=DoorStatus.UNDEFINED,
            sensor=True,
            sensorid=None,
            camera=False,
            events=0,
            temperature=temperature,
            voltage=battery_level,
        ),
        outputs=Outputs(output1=True, output2=False, output3=True),
        network=Network(ip=""),
        wifi=Wifi(SSID="", linkquality="", signal=""),
    )