-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbython.py
163 lines (119 loc) · 3.87 KB
/
bython.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
from sdv_model import Vehicle
import plugins
from browser import aio
Welcome_plugin = plugins.get_plugin("Welcome_plugin")
await Welcome_plugin.refresh()
print = plugins.Terminal.print
vehicle = Vehicle()
plugins.Terminal.reset()
await Welcome_plugin.start()
driverPickFlag = False
interval = 1
print("hello passenger!")
### select driver
# Vehicle Key Detection
await Welcome_plugin.nextStepPY()
await aio.sleep(interval)
# Driver Identification
await Welcome_plugin.nextStepPY()
await aio.sleep(interval)
# Check Memory Data
await Welcome_plugin.nextStepPY()
await vehicle.Cabin.Door.Row1.Left.IsOpen.set(True)
await aio.sleep(interval)
# Judge
await Welcome_plugin.nextStepPY()
isPersonal = await Welcome_plugin.isPersonalPY()
#print(isPersonal)
await aio.sleep(interval)
# Pull Driver
Welcome_plugin.nextStepPY()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await vehicle.Cabin.Seat.Row1.Pos1.Height.set(100)
await Welcome_plugin.setSeatPosition()
await aio.sleep(3)
### Welcome
await Welcome_plugin.nextStepPY()
await Welcome_plugin.displayCockpitPY()
await Welcome_plugin.setPersonalizedWelcomeWord()
await aio.sleep(interval)
### await Welcome_plugin.nextStepPY()
### await Welcome_plugin.setPersonalizedUIInterface()
### await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setPreferLanguage()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setUSMetricUnits()
await aio.sleep(interval)
### Serval Settings
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setInteriorLight()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setParkingWarningBeepLevel()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.turnOnPreferredMusic()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setAutoHold()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setMirrorStatus()
await aio.sleep(interval)
### Set Drive Mode
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setOnePuddleDrive()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setDriveMode()
await aio.sleep(interval)
### Set Comfort Setting
await Welcome_plugin.nextStepPY()
outsideTemperature = int(await Welcome_plugin.getOutsideTemperature())
print("outside temperature is: %d"%(outsideTemperature))
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await aio.sleep(interval)
if(outsideTemperature < 9):
# too cold
print("too cold, open warm AC")
await Welcome_plugin.nextStepPY()
await Welcome_plugin.turnOnSetAC("warm AC")
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.turnOnSeatHeat()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.turnSteeringWheelWarm()
await aio.sleep(interval)
else:
await Welcome_plugin.nextStepPY()
await aio.sleep(interval)
# too hot
if(outsideTemperature > 25):
print("too hot, open cool AC")
await Welcome_plugin.nextStepPY()
await Welcome_plugin.turnOnSetAC("cool AC")
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.turnOnSeatVentilation()
await aio.sleep(interval)
else:
print("normal temperature, no automatic AC")
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setACAirFlow()
await aio.sleep(interval)
await Welcome_plugin.nextStepPY()
await Welcome_plugin.setADASWarningBeepLevel()
await aio.sleep(interval)
test3 = await vehicle.Cabin.HVAC.Station.Row1.Left.Temperature.get()
# print(test3)
test1 = await vehicle.Body.Lights.IsHighBeamOn.get()
# print(test1)
test2 = await vehicle.Cabin.Seat.Row1.Pos1.Position.get()
# print(test2)
await vehicle.Cabin.Door.Row1.Left.IsOpen.set(False)
await vehicle.Cabin.Seat.Row1.Pos1.Height.set(0)