18
18
import logging
19
19
20
20
from vehicle import Vehicle # type: ignore
21
+
21
22
from velocitas_sdk .util .log import ( # type: ignore
22
23
get_opentelemetry_log_factory ,
23
24
get_opentelemetry_log_format ,
@@ -40,7 +41,7 @@ class SeatAdjusterApp(VehicleApp):
40
41
upon such a request, but only if Vehicle.Speed equals 0.
41
42
42
43
It also subcribes to the VehicleDataBroker for updates of the
43
- Vehicle.Cabin.Seat.Row1.Pos1 .Position signal and publishes this
44
+ Vehicle.Cabin.Seat.Row1.DriverSide .Position signal and publishes this
44
45
information via another specific MQTT topic
45
46
"""
46
47
@@ -50,7 +51,7 @@ def __init__(self, vehicle_client: Vehicle):
50
51
51
52
async def on_start (self ):
52
53
"""Run when the vehicle app starts"""
53
- await self .Vehicle .Cabin .Seat .Row1 .Pos1 .Position .subscribe (
54
+ await self .Vehicle .Cabin .Seat .Row1 .DriverSide .Position .subscribe (
54
55
self .on_seat_position_changed
55
56
)
56
57
@@ -59,7 +60,11 @@ async def on_seat_position_changed(self, data: DataPointReply):
59
60
await self .publish_event (
60
61
response_topic ,
61
62
json .dumps (
62
- {"position" : data .get (self .Vehicle .Cabin .Seat .Row1 .Pos1 .Position ).value }
63
+ {
64
+ "position" : data .get (
65
+ self .Vehicle .Cabin .Seat .Row1 .DriverSide .Position
66
+ ).value
67
+ }
63
68
),
64
69
)
65
70
@@ -75,7 +80,7 @@ async def on_set_position_request_received(self, data_str: str) -> None:
75
80
position = data ["position" ]
76
81
if vehicle_speed == 0 :
77
82
try :
78
- await self .Vehicle .Cabin .Seat .Row1 .Pos1 .Position .set (position )
83
+ await self .Vehicle .Cabin .Seat .Row1 .DriverSide .Position .set (position )
79
84
response_data ["result" ] = {
80
85
"status" : 0 ,
81
86
"message" : f"Set Seat position to: { position } " ,
0 commit comments