tescmd 0.2.0__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tescmd/__init__.py +1 -1
- tescmd/api/client.py +41 -4
- tescmd/api/command.py +1 -1
- tescmd/api/errors.py +5 -0
- tescmd/api/signed_command.py +19 -14
- tescmd/auth/oauth.py +15 -1
- tescmd/auth/server.py +6 -1
- tescmd/auth/token_store.py +8 -1
- tescmd/cache/response_cache.py +8 -1
- tescmd/cli/_client.py +142 -20
- tescmd/cli/_options.py +2 -4
- tescmd/cli/auth.py +255 -106
- tescmd/cli/energy.py +2 -0
- tescmd/cli/key.py +6 -7
- tescmd/cli/main.py +27 -8
- tescmd/cli/mcp_cmd.py +153 -0
- tescmd/cli/nav.py +3 -1
- tescmd/cli/openclaw.py +169 -0
- tescmd/cli/security.py +7 -1
- tescmd/cli/serve.py +923 -0
- tescmd/cli/setup.py +147 -58
- tescmd/cli/sharing.py +2 -0
- tescmd/cli/status.py +1 -1
- tescmd/cli/trunk.py +8 -17
- tescmd/cli/user.py +16 -1
- tescmd/cli/vehicle.py +135 -462
- tescmd/deploy/github_pages.py +21 -2
- tescmd/deploy/tailscale_serve.py +96 -8
- tescmd/mcp/__init__.py +7 -0
- tescmd/mcp/server.py +648 -0
- tescmd/models/auth.py +5 -2
- tescmd/openclaw/__init__.py +23 -0
- tescmd/openclaw/bridge.py +330 -0
- tescmd/openclaw/config.py +167 -0
- tescmd/openclaw/dispatcher.py +529 -0
- tescmd/openclaw/emitter.py +175 -0
- tescmd/openclaw/filters.py +123 -0
- tescmd/openclaw/gateway.py +700 -0
- tescmd/openclaw/telemetry_store.py +53 -0
- tescmd/output/rich_output.py +46 -14
- tescmd/protocol/commands.py +2 -2
- tescmd/protocol/encoder.py +16 -13
- tescmd/protocol/payloads.py +132 -11
- tescmd/protocol/session.py +8 -5
- tescmd/protocol/signer.py +3 -17
- tescmd/telemetry/__init__.py +9 -0
- tescmd/telemetry/cache_sink.py +154 -0
- tescmd/telemetry/csv_sink.py +180 -0
- tescmd/telemetry/dashboard.py +4 -4
- tescmd/telemetry/fanout.py +49 -0
- tescmd/telemetry/fields.py +308 -129
- tescmd/telemetry/mapper.py +239 -0
- tescmd/telemetry/server.py +26 -19
- tescmd/telemetry/setup.py +468 -0
- tescmd/telemetry/tailscale.py +78 -16
- tescmd/telemetry/tui.py +1716 -0
- tescmd/triggers/__init__.py +18 -0
- tescmd/triggers/manager.py +264 -0
- tescmd/triggers/models.py +93 -0
- tescmd-0.4.0.dist-info/METADATA +300 -0
- {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/RECORD +64 -42
- tescmd-0.2.0.dist-info/METADATA +0 -495
- {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/WHEEL +0 -0
- {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/entry_points.txt +0 -0
- {tescmd-0.2.0.dist-info → tescmd-0.4.0.dist-info}/licenses/LICENSE +0 -0
tescmd/telemetry/fields.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Fleet Telemetry field name registry and preset configurations.
|
|
2
2
|
|
|
3
|
-
Field IDs sourced from Tesla's ``vehicle_data.proto`` Field enum
|
|
3
|
+
Field IDs and names sourced from Tesla's ``vehicle_data.proto`` Field enum
|
|
4
|
+
(https://github.com/teslamotors/fleet-telemetry/blob/main/protos/vehicle_data.proto).
|
|
5
|
+
|
|
4
6
|
Presets define commonly-used field groups with appropriate polling
|
|
5
7
|
intervals for different use cases.
|
|
6
8
|
"""
|
|
@@ -11,131 +13,299 @@ from tescmd.api.errors import ConfigError
|
|
|
11
13
|
|
|
12
14
|
# ---------------------------------------------------------------------------
|
|
13
15
|
# Field enum → human-readable name (from vehicle_data.proto)
|
|
16
|
+
#
|
|
17
|
+
# IDs and names match the proto exactly. Excluded:
|
|
18
|
+
# - Unknown (0)
|
|
19
|
+
# - Deprecated_1 (162), Deprecated_2 (100), Deprecated_3 (257)
|
|
20
|
+
# - Experimental_1-15 (119-122, 168-178)
|
|
14
21
|
# ---------------------------------------------------------------------------
|
|
15
22
|
|
|
16
23
|
FIELD_NAMES: dict[int, str] = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
3: "Soc",
|
|
24
|
+
# --- Drive / Motion ---
|
|
25
|
+
1: "DriveRail",
|
|
20
26
|
4: "VehicleSpeed",
|
|
21
27
|
5: "Odometer",
|
|
22
|
-
6: "PackVoltage",
|
|
23
|
-
7: "PackCurrent",
|
|
24
|
-
8: "BatteryLevel",
|
|
25
|
-
9: "Location",
|
|
26
28
|
10: "Gear",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
19: "ChargeCurrentRequestMax",
|
|
36
|
-
20: "ChargeLimitSoc",
|
|
37
|
-
21: "ChargePortDoorOpen",
|
|
38
|
-
22: "ChargePortLatch",
|
|
39
|
-
23: "ChargerActualCurrent",
|
|
40
|
-
24: "ChargerPhases",
|
|
41
|
-
25: "ChargerPilotCurrent",
|
|
42
|
-
26: "ChargerVoltage",
|
|
43
|
-
27: "FastChargerPresent",
|
|
44
|
-
28: "ScheduledChargingMode",
|
|
45
|
-
29: "ScheduledChargingPending",
|
|
46
|
-
30: "ScheduledChargingStartTime",
|
|
47
|
-
31: "ScheduledDepartureTime",
|
|
48
|
-
32: "TimeToFullCharge",
|
|
49
|
-
33: "InsideTemp",
|
|
50
|
-
34: "OutsideTemp",
|
|
51
|
-
35: "DriverTempSetting",
|
|
52
|
-
36: "PassengerTempSetting",
|
|
53
|
-
37: "IsClimateOn",
|
|
54
|
-
38: "FanStatus",
|
|
55
|
-
39: "LeftTempDirection",
|
|
56
|
-
40: "RightTempDirection",
|
|
57
|
-
41: "SeatHeaterLeft",
|
|
58
|
-
42: "SeatHeaterRight",
|
|
59
|
-
43: "SeatHeaterRearLeft",
|
|
60
|
-
44: "SeatHeaterRearCenter",
|
|
61
|
-
45: "SeatHeaterRearRight",
|
|
62
|
-
46: "SteeringWheelHeater",
|
|
63
|
-
47: "AutoSeatClimateLeft",
|
|
64
|
-
48: "AutoSeatClimateRight",
|
|
65
|
-
49: "CabinOverheatProtection",
|
|
66
|
-
50: "DefrostMode",
|
|
67
|
-
51: "Locked",
|
|
68
|
-
52: "SentryMode",
|
|
69
|
-
53: "CenterDisplay",
|
|
70
|
-
54: "ValetMode",
|
|
71
|
-
55: "RemoteStart",
|
|
72
|
-
56: "DoorState",
|
|
73
|
-
57: "WindowState",
|
|
74
|
-
58: "TrunkOpen",
|
|
75
|
-
59: "FrunkOpen",
|
|
76
|
-
60: "SoftwareVersion",
|
|
77
|
-
61: "TpmsPressureFl",
|
|
78
|
-
62: "TpmsPressureFr",
|
|
79
|
-
63: "TpmsPressureRl",
|
|
80
|
-
64: "TpmsPressureRr",
|
|
81
|
-
65: "DetailedChargeState",
|
|
82
|
-
66: "HomeLink",
|
|
83
|
-
67: "UserPresent",
|
|
84
|
-
68: "DashcamState",
|
|
85
|
-
69: "RearSeatHeaters",
|
|
86
|
-
70: "BatteryHeaterOn",
|
|
87
|
-
71: "NotEnoughPowerToHeat",
|
|
88
|
-
72: "BmsFullchargecomplete",
|
|
89
|
-
73: "ChargeEnablerequest",
|
|
90
|
-
74: "ChargerPhases2",
|
|
91
|
-
75: "EnergyRemaining",
|
|
92
|
-
76: "LifetimeEnergyUsed",
|
|
93
|
-
77: "LifetimeEnergyUsedDrive",
|
|
94
|
-
78: "BMSState",
|
|
95
|
-
79: "GuestModeEnabled",
|
|
96
|
-
80: "PreconditioningEnabled",
|
|
97
|
-
81: "ScheduledChargingStartTimeApp",
|
|
98
|
-
82: "TripCharging",
|
|
99
|
-
83: "ChargingCableType",
|
|
100
|
-
84: "RouteLastUpdated",
|
|
101
|
-
85: "RouteLine",
|
|
102
|
-
86: "MilesToArrival",
|
|
103
|
-
87: "MinutesToArrival",
|
|
104
|
-
88: "TrafficMinutesDelay",
|
|
105
|
-
89: "Elevation",
|
|
106
|
-
90: "Heading",
|
|
107
|
-
91: "PowerState",
|
|
108
|
-
92: "RatedRange",
|
|
109
|
-
93: "CruiseState",
|
|
110
|
-
94: "CruiseSetSpeed",
|
|
111
|
-
95: "LaneAssistLevel",
|
|
112
|
-
96: "AutopilotState",
|
|
113
|
-
97: "AutopilotHandsOnState",
|
|
114
|
-
98: "SpeedLimitMode",
|
|
115
|
-
99: "SpeedLimitWarning",
|
|
116
|
-
100: "MaxSpeedLimit",
|
|
117
|
-
101: "SunRoofPercentOpen",
|
|
118
|
-
102: "SunRoofState",
|
|
119
|
-
103: "TonneauPosition",
|
|
120
|
-
104: "TonneauState",
|
|
121
|
-
105: "WiperHeatEnabled",
|
|
29
|
+
12: "PedalPosition",
|
|
30
|
+
13: "BrakePedal",
|
|
31
|
+
21: "Location",
|
|
32
|
+
22: "GpsState",
|
|
33
|
+
23: "GpsHeading",
|
|
34
|
+
98: "LateralAcceleration",
|
|
35
|
+
99: "LongitudinalAcceleration",
|
|
36
|
+
101: "CruiseSetSpeed",
|
|
122
37
|
106: "BrakePedalPos",
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
38
|
+
126: "CruiseFollowDistance",
|
|
39
|
+
129: "SpeedLimitWarning",
|
|
40
|
+
# --- Battery / Energy ---
|
|
41
|
+
6: "PackVoltage",
|
|
42
|
+
7: "PackCurrent",
|
|
43
|
+
8: "Soc",
|
|
44
|
+
9: "DCDCEnable",
|
|
45
|
+
11: "IsolationResistance",
|
|
46
|
+
24: "NumBrickVoltageMax",
|
|
47
|
+
25: "BrickVoltageMax",
|
|
48
|
+
26: "NumBrickVoltageMin",
|
|
49
|
+
27: "BrickVoltageMin",
|
|
50
|
+
28: "NumModuleTempMax",
|
|
51
|
+
29: "ModuleTempMax",
|
|
52
|
+
30: "NumModuleTempMin",
|
|
53
|
+
31: "ModuleTempMin",
|
|
54
|
+
32: "RatedRange",
|
|
55
|
+
33: "Hvil",
|
|
56
|
+
40: "EstBatteryRange",
|
|
57
|
+
41: "IdealBatteryRange",
|
|
58
|
+
42: "BatteryLevel",
|
|
59
|
+
55: "BatteryHeaterOn",
|
|
60
|
+
56: "NotEnoughPowerToHeat",
|
|
61
|
+
102: "LifetimeEnergyUsed",
|
|
62
|
+
103: "LifetimeEnergyUsedDrive",
|
|
63
|
+
134: "LifetimeEnergyGainedRegen",
|
|
64
|
+
158: "EnergyRemaining",
|
|
65
|
+
160: "BMSState",
|
|
66
|
+
# --- Charging ---
|
|
67
|
+
2: "ChargeState",
|
|
68
|
+
3: "BmsFullchargecomplete",
|
|
69
|
+
34: "DCChargingEnergyIn",
|
|
70
|
+
35: "DCChargingPower",
|
|
71
|
+
36: "ACChargingEnergyIn",
|
|
72
|
+
37: "ACChargingPower",
|
|
73
|
+
38: "ChargeLimitSoc",
|
|
74
|
+
39: "FastChargerPresent",
|
|
75
|
+
43: "TimeToFullCharge",
|
|
76
|
+
44: "ScheduledChargingStartTime",
|
|
77
|
+
45: "ScheduledChargingPending",
|
|
78
|
+
46: "ScheduledDepartureTime",
|
|
79
|
+
47: "PreconditioningEnabled",
|
|
80
|
+
48: "ScheduledChargingMode",
|
|
81
|
+
49: "ChargeAmps",
|
|
82
|
+
50: "ChargeEnableRequest",
|
|
83
|
+
51: "ChargerPhases",
|
|
84
|
+
52: "ChargePortColdWeatherMode",
|
|
85
|
+
53: "ChargeCurrentRequest",
|
|
86
|
+
54: "ChargeCurrentRequestMax",
|
|
87
|
+
57: "SuperchargerSessionTripPlanner",
|
|
88
|
+
117: "ChargePort",
|
|
89
|
+
118: "ChargePortLatch",
|
|
90
|
+
179: "DetailedChargeState",
|
|
91
|
+
183: "ChargePortDoorOpen",
|
|
92
|
+
184: "ChargerVoltage",
|
|
93
|
+
185: "ChargingCableType",
|
|
94
|
+
190: "EstimatedHoursToChargeTermination",
|
|
95
|
+
193: "FastChargerType",
|
|
96
|
+
256: "ChargeRateMilePerHour",
|
|
97
|
+
# --- Climate / HVAC ---
|
|
98
|
+
85: "InsideTemp",
|
|
99
|
+
86: "OutsideTemp",
|
|
100
|
+
87: "SeatHeaterLeft",
|
|
101
|
+
88: "SeatHeaterRight",
|
|
102
|
+
89: "SeatHeaterRearLeft",
|
|
103
|
+
90: "SeatHeaterRearRight",
|
|
104
|
+
91: "SeatHeaterRearCenter",
|
|
105
|
+
92: "AutoSeatClimateLeft",
|
|
106
|
+
93: "AutoSeatClimateRight",
|
|
107
|
+
186: "ClimateKeeperMode",
|
|
108
|
+
187: "DefrostForPreconditioning",
|
|
109
|
+
188: "DefrostMode",
|
|
110
|
+
196: "HvacACEnabled",
|
|
111
|
+
197: "HvacAutoMode",
|
|
112
|
+
198: "HvacFanSpeed",
|
|
113
|
+
199: "HvacFanStatus",
|
|
114
|
+
200: "HvacLeftTemperatureRequest",
|
|
115
|
+
201: "HvacPower",
|
|
116
|
+
202: "HvacRightTemperatureRequest",
|
|
117
|
+
203: "HvacSteeringWheelHeatAuto",
|
|
118
|
+
204: "HvacSteeringWheelHeatLevel",
|
|
119
|
+
211: "RearDisplayHvacEnabled",
|
|
120
|
+
237: "ClimateSeatCoolingFrontLeft",
|
|
121
|
+
238: "ClimateSeatCoolingFrontRight",
|
|
122
|
+
254: "SeatVentEnabled",
|
|
123
|
+
255: "RearDefrostEnabled",
|
|
124
|
+
180: "CabinOverheatProtectionMode",
|
|
125
|
+
181: "CabinOverheatProtectionTemperatureLimit",
|
|
126
|
+
# --- Security / Doors / Windows ---
|
|
127
|
+
58: "DoorState",
|
|
128
|
+
59: "Locked",
|
|
129
|
+
60: "FdWindow",
|
|
130
|
+
61: "FpWindow",
|
|
131
|
+
62: "RdWindow",
|
|
132
|
+
63: "RpWindow",
|
|
133
|
+
64: "VehicleName",
|
|
134
|
+
65: "SentryMode",
|
|
135
|
+
66: "SpeedLimitMode",
|
|
136
|
+
67: "CurrentLimitMph",
|
|
137
|
+
68: "Version",
|
|
138
|
+
94: "DriverSeatBelt",
|
|
139
|
+
95: "PassengerSeatBelt",
|
|
140
|
+
96: "DriverSeatOccupied",
|
|
141
|
+
123: "GuestModeEnabled",
|
|
142
|
+
124: "PinToDriveEnabled",
|
|
143
|
+
125: "PairedPhoneKeyAndKeyFobQty",
|
|
144
|
+
159: "ServiceMode",
|
|
145
|
+
161: "GuestModeMobileAccessState",
|
|
146
|
+
182: "CenterDisplay",
|
|
147
|
+
213: "RemoteStartEnabled",
|
|
148
|
+
226: "ValetModeEnabled",
|
|
149
|
+
# --- Tires ---
|
|
150
|
+
69: "TpmsPressureFl",
|
|
151
|
+
70: "TpmsPressureFr",
|
|
152
|
+
71: "TpmsPressureRl",
|
|
153
|
+
72: "TpmsPressureRr",
|
|
154
|
+
81: "TpmsLastSeenPressureTimeFl",
|
|
155
|
+
82: "TpmsLastSeenPressureTimeFr",
|
|
156
|
+
83: "TpmsLastSeenPressureTimeRl",
|
|
157
|
+
84: "TpmsLastSeenPressureTimeRr",
|
|
158
|
+
224: "TpmsHardWarnings",
|
|
159
|
+
225: "TpmsSoftWarnings",
|
|
160
|
+
# --- Drive Inverter (per-motor diagnostics) ---
|
|
161
|
+
14: "DiStateR",
|
|
162
|
+
15: "DiHeatsinkTR",
|
|
163
|
+
16: "DiAxleSpeedR",
|
|
164
|
+
17: "DiTorquemotor",
|
|
165
|
+
18: "DiStatorTempR",
|
|
166
|
+
19: "DiVBatR",
|
|
167
|
+
20: "DiMotorCurrentR",
|
|
168
|
+
135: "DiStateF",
|
|
169
|
+
136: "DiStateREL",
|
|
170
|
+
137: "DiStateRER",
|
|
171
|
+
138: "DiHeatsinkTF",
|
|
172
|
+
139: "DiHeatsinkTREL",
|
|
173
|
+
140: "DiHeatsinkTRER",
|
|
174
|
+
141: "DiAxleSpeedF",
|
|
175
|
+
142: "DiAxleSpeedREL",
|
|
176
|
+
143: "DiAxleSpeedRER",
|
|
177
|
+
144: "DiSlaveTorqueCmd",
|
|
178
|
+
145: "DiTorqueActualR",
|
|
179
|
+
146: "DiTorqueActualF",
|
|
180
|
+
147: "DiTorqueActualREL",
|
|
181
|
+
148: "DiTorqueActualRER",
|
|
182
|
+
149: "DiStatorTempF",
|
|
183
|
+
150: "DiStatorTempREL",
|
|
184
|
+
151: "DiStatorTempRER",
|
|
185
|
+
152: "DiVBatF",
|
|
186
|
+
153: "DiVBatREL",
|
|
187
|
+
154: "DiVBatRER",
|
|
188
|
+
155: "DiMotorCurrentF",
|
|
189
|
+
156: "DiMotorCurrentREL",
|
|
190
|
+
157: "DiMotorCurrentRER",
|
|
191
|
+
164: "DiInverterTR",
|
|
192
|
+
165: "DiInverterTF",
|
|
193
|
+
166: "DiInverterTREL",
|
|
194
|
+
167: "DiInverterTRER",
|
|
195
|
+
# --- Navigation / Route ---
|
|
196
|
+
107: "RouteLastUpdated",
|
|
197
|
+
108: "RouteLine",
|
|
198
|
+
109: "MilesToArrival",
|
|
199
|
+
110: "MinutesToArrival",
|
|
200
|
+
111: "OriginLocation",
|
|
201
|
+
112: "DestinationLocation",
|
|
202
|
+
163: "DestinationName",
|
|
203
|
+
215: "RouteTrafficMinutesDelay",
|
|
204
|
+
192: "ExpectedEnergyPercentAtTripArrival",
|
|
205
|
+
# --- Vehicle Info / Config ---
|
|
206
|
+
113: "CarType",
|
|
207
|
+
114: "Trim",
|
|
208
|
+
115: "ExteriorColor",
|
|
209
|
+
116: "RoofColor",
|
|
210
|
+
189: "EfficiencyPackage",
|
|
211
|
+
191: "EuropeVehicle",
|
|
212
|
+
214: "RightHandDrive",
|
|
213
|
+
227: "WheelType",
|
|
214
|
+
228: "WiperHeatEnabled",
|
|
215
|
+
# --- Safety / ADAS ---
|
|
216
|
+
127: "AutomaticBlindSpotCamera",
|
|
217
|
+
128: "BlindSpotCollisionWarningChime",
|
|
218
|
+
130: "ForwardCollisionWarning",
|
|
219
|
+
131: "LaneDepartureAvoidance",
|
|
220
|
+
132: "EmergencyLaneDepartureAvoidance",
|
|
221
|
+
133: "AutomaticEmergencyBrakingOff",
|
|
222
|
+
# --- Powershare ---
|
|
223
|
+
206: "PowershareHoursLeft",
|
|
224
|
+
207: "PowershareInstantaneousPowerKW",
|
|
225
|
+
208: "PowershareStatus",
|
|
226
|
+
209: "PowershareStopReason",
|
|
227
|
+
210: "PowershareType",
|
|
228
|
+
# --- Homelink ---
|
|
229
|
+
194: "HomelinkDeviceCount",
|
|
230
|
+
195: "HomelinkNearby",
|
|
231
|
+
# --- Software Updates ---
|
|
232
|
+
216: "SoftwareUpdateDownloadPercentComplete",
|
|
233
|
+
217: "SoftwareUpdateExpectedDurationMinutes",
|
|
234
|
+
218: "SoftwareUpdateInstallationPercentComplete",
|
|
235
|
+
219: "SoftwareUpdateScheduledStartTime",
|
|
236
|
+
220: "SoftwareUpdateVersion",
|
|
237
|
+
# --- Tonneau ---
|
|
238
|
+
221: "TonneauOpenPercent",
|
|
239
|
+
222: "TonneauPosition",
|
|
240
|
+
223: "TonneauTentMode",
|
|
241
|
+
# --- Location Context ---
|
|
242
|
+
229: "LocatedAtHome",
|
|
243
|
+
230: "LocatedAtWork",
|
|
244
|
+
231: "LocatedAtFavorite",
|
|
245
|
+
# --- Settings ---
|
|
246
|
+
232: "SettingDistanceUnit",
|
|
247
|
+
233: "SettingTemperatureUnit",
|
|
248
|
+
234: "Setting24HourTime",
|
|
249
|
+
235: "SettingTirePressureUnit",
|
|
250
|
+
236: "SettingChargeUnit",
|
|
251
|
+
# --- Lights ---
|
|
252
|
+
239: "LightsHazardsActive",
|
|
253
|
+
240: "LightsTurnSignal",
|
|
254
|
+
241: "LightsHighBeams",
|
|
255
|
+
# --- Media ---
|
|
256
|
+
242: "MediaPlaybackStatus",
|
|
257
|
+
243: "MediaPlaybackSource",
|
|
258
|
+
244: "MediaAudioVolume",
|
|
259
|
+
245: "MediaNowPlayingDuration",
|
|
260
|
+
246: "MediaNowPlayingElapsed",
|
|
261
|
+
247: "MediaNowPlayingArtist",
|
|
262
|
+
248: "MediaNowPlayingTitle",
|
|
263
|
+
249: "MediaNowPlayingAlbum",
|
|
264
|
+
250: "MediaNowPlayingStation",
|
|
265
|
+
251: "MediaAudioVolumeIncrement",
|
|
266
|
+
252: "MediaAudioVolumeMax",
|
|
267
|
+
# --- Misc ---
|
|
268
|
+
205: "OffroadLightbarPresent",
|
|
269
|
+
212: "RearSeatHeaters",
|
|
270
|
+
253: "SunroofInstalled",
|
|
271
|
+
258: "MilesSinceReset",
|
|
272
|
+
259: "SelfDrivingMilesSinceReset",
|
|
273
|
+
# --- Semi-truck (included for completeness, excluded from presets) ---
|
|
274
|
+
73: "SemitruckTpmsPressureRe1L0",
|
|
275
|
+
74: "SemitruckTpmsPressureRe1L1",
|
|
276
|
+
75: "SemitruckTpmsPressureRe1R0",
|
|
277
|
+
76: "SemitruckTpmsPressureRe1R1",
|
|
278
|
+
77: "SemitruckTpmsPressureRe2L0",
|
|
279
|
+
78: "SemitruckTpmsPressureRe2L1",
|
|
280
|
+
79: "SemitruckTpmsPressureRe2R0",
|
|
281
|
+
80: "SemitruckTpmsPressureRe2R1",
|
|
282
|
+
97: "SemitruckPassengerSeatFoldPosition",
|
|
283
|
+
104: "SemitruckTractorParkBrakeStatus",
|
|
284
|
+
105: "SemitruckTrailerParkBrakeStatus",
|
|
137
285
|
}
|
|
138
286
|
|
|
287
|
+
# ---------------------------------------------------------------------------
|
|
288
|
+
# Fields that exist in vehicle_data.proto but should be excluded from the
|
|
289
|
+
# "all" preset. Semi-truck fields won't work on consumer vehicles.
|
|
290
|
+
# LifetimeEnergyGainedRegen returns "unsupported_field" on many vehicles.
|
|
291
|
+
# ---------------------------------------------------------------------------
|
|
292
|
+
|
|
293
|
+
_NON_STREAMABLE_FIELDS: frozenset[str] = frozenset(
|
|
294
|
+
{name for name in FIELD_NAMES.values() if name.startswith("Semitruck")}
|
|
295
|
+
| {
|
|
296
|
+
"LifetimeEnergyGainedRegen", # returns "unsupported_field" on many vehicles
|
|
297
|
+
}
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
# Fields that require minimum_delta instead of interval_seconds.
|
|
301
|
+
# Tesla's API rejects these if minimum_delta is not explicitly set >= 1.
|
|
302
|
+
_DELTA_FIELDS: frozenset[str] = frozenset(
|
|
303
|
+
{
|
|
304
|
+
"MilesSinceReset",
|
|
305
|
+
"SelfDrivingMilesSinceReset",
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
|
|
139
309
|
# ---------------------------------------------------------------------------
|
|
140
310
|
# Preset field configurations
|
|
141
311
|
# ---------------------------------------------------------------------------
|
|
@@ -160,16 +330,17 @@ PRESETS: dict[str, dict[str, dict[str, int]]] = {
|
|
|
160
330
|
"VehicleSpeed": {"interval_seconds": 1},
|
|
161
331
|
"Location": {"interval_seconds": 1},
|
|
162
332
|
"Gear": {"interval_seconds": 1},
|
|
163
|
-
"
|
|
333
|
+
"GpsHeading": {"interval_seconds": 1},
|
|
164
334
|
"Odometer": {"interval_seconds": 10},
|
|
165
|
-
"Elevation": {"interval_seconds": 5},
|
|
166
335
|
"BatteryLevel": {"interval_seconds": 10},
|
|
167
336
|
"Soc": {"interval_seconds": 10},
|
|
168
337
|
"PackCurrent": {"interval_seconds": 5},
|
|
169
338
|
"PackVoltage": {"interval_seconds": 5},
|
|
170
|
-
"CruiseState": {"interval_seconds": 5},
|
|
171
339
|
"CruiseSetSpeed": {"interval_seconds": 5},
|
|
172
|
-
"
|
|
340
|
+
"LateralAcceleration": {"interval_seconds": 5},
|
|
341
|
+
"LongitudinalAcceleration": {"interval_seconds": 5},
|
|
342
|
+
"BrakePedalPos": {"interval_seconds": 5},
|
|
343
|
+
"PedalPosition": {"interval_seconds": 5},
|
|
173
344
|
},
|
|
174
345
|
"charging": {
|
|
175
346
|
"Soc": {"interval_seconds": 5},
|
|
@@ -177,7 +348,7 @@ PRESETS: dict[str, dict[str, dict[str, int]]] = {
|
|
|
177
348
|
"PackVoltage": {"interval_seconds": 5},
|
|
178
349
|
"PackCurrent": {"interval_seconds": 5},
|
|
179
350
|
"ChargeState": {"interval_seconds": 5},
|
|
180
|
-
"
|
|
351
|
+
"ChargeAmps": {"interval_seconds": 5},
|
|
181
352
|
"ChargerVoltage": {"interval_seconds": 5},
|
|
182
353
|
"ChargerPhases": {"interval_seconds": 30},
|
|
183
354
|
"ACChargingPower": {"interval_seconds": 5},
|
|
@@ -191,18 +362,26 @@ PRESETS: dict[str, dict[str, dict[str, int]]] = {
|
|
|
191
362
|
"climate": {
|
|
192
363
|
"InsideTemp": {"interval_seconds": 10},
|
|
193
364
|
"OutsideTemp": {"interval_seconds": 30},
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
365
|
+
"HvacLeftTemperatureRequest": {"interval_seconds": 30},
|
|
366
|
+
"HvacRightTemperatureRequest": {"interval_seconds": 30},
|
|
367
|
+
"HvacPower": {"interval_seconds": 10},
|
|
368
|
+
"HvacFanStatus": {"interval_seconds": 10},
|
|
198
369
|
"SeatHeaterLeft": {"interval_seconds": 30},
|
|
199
370
|
"SeatHeaterRight": {"interval_seconds": 30},
|
|
200
|
-
"
|
|
201
|
-
"
|
|
371
|
+
"HvacSteeringWheelHeatLevel": {"interval_seconds": 30},
|
|
372
|
+
"CabinOverheatProtectionMode": {"interval_seconds": 60},
|
|
202
373
|
"DefrostMode": {"interval_seconds": 30},
|
|
203
374
|
"PreconditioningEnabled": {"interval_seconds": 30},
|
|
204
375
|
},
|
|
205
|
-
"all": {
|
|
376
|
+
"all": {
|
|
377
|
+
name: (
|
|
378
|
+
{"interval_seconds": 30, "minimum_delta": 1}
|
|
379
|
+
if name in _DELTA_FIELDS
|
|
380
|
+
else {"interval_seconds": 30}
|
|
381
|
+
)
|
|
382
|
+
for name in FIELD_NAMES.values()
|
|
383
|
+
if name not in _NON_STREAMABLE_FIELDS
|
|
384
|
+
},
|
|
206
385
|
}
|
|
207
386
|
|
|
208
387
|
# Reverse lookup: name → ID
|