Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/rivian/parallax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
Reads a raw `subscribe_for_parallax_command_state` message.
encode_end_trip(user_id) -> str
Builds the unsigned `end_trip` request.
encode_live_streaming(camera, device_id) -> bytes
A Gear Guard live stream start, for `start_gear_guard_live_stream`.
encode_climate_hold(on), encode_pet_mode(on) -> bytes
Payloads for the signed SET_CLIMATE_HOLD_RVM and SET_PET_MODE_RVM
commands.

Layout:
core.py - registry, payload parsing and shared helpers
Expand Down Expand Up @@ -58,7 +63,11 @@
from .comfort import (
CLIMATE_HOLD_SETTING_RVM,
CLIMATE_HOLD_STATUS_RVM,
SET_CLIMATE_HOLD_RVM,
SET_PET_MODE_RVM,
encode_climate_hold,
encode_climate_hold_setting,
encode_pet_mode,
)
from .command import decode_command_state_message, encode_command
from .core import (
Expand All @@ -68,6 +77,11 @@
)
from .navigation import UPDATED_TRIP_MODEL, encode_end_trip
from .operation import encode_vehicle_operation
from .security import (
GEAR_GUARD_CAMERAS,
START_LIVE_STREAMING_RVM,
encode_live_streaming,
)

PARALLAX_RVMS: list[str] = list(RVMDecoder.decoders)

Expand All @@ -88,17 +102,24 @@
"CHARGING_RVMS",
"CLIMATE_HOLD_SETTING_RVM",
"CLIMATE_HOLD_STATUS_RVM",
"GEAR_GUARD_CAMERAS",
"LOCK_RVM",
"PARALLAX_RVMS",
"SET_CLIMATE_HOLD_RVM",
"SET_PET_MODE_RVM",
"START_LIVE_STREAMING_RVM",
"UNLOCK_RVM",
"UPDATED_TRIP_MODEL",
"decode_command_state_message",
"decode_parallax_message",
"decode_parallax_subscription_message",
"encode_climate_hold",
"encode_climate_hold_setting",
"encode_command",
"encode_end_trip",
"encode_live_streaming",
"encode_lock",
"encode_pet_mode",
"encode_unlock",
"encode_vehicle_operation",
]
14 changes: 14 additions & 0 deletions src/rivian/parallax/comfort.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

CLIMATE_HOLD_SETTING_RVM: Final = "comfort.cabin.climate_hold_setting"
CLIMATE_HOLD_STATUS_RVM: Final = "comfort.cabin.climate_hold_status"
SET_CLIMATE_HOLD_RVM: Final = "comfort.cabin.set_climate_hold"
SET_PET_MODE_RVM: Final = "comfort.cabin.set_pet_mode"


@RVMDecoder.register(
Expand Down Expand Up @@ -208,6 +210,18 @@ def encode_climate_hold_setting(duration_seconds: int) -> bytes:
return comfort_pb2.ClimateHoldSetting(duration=duration_seconds).SerializeToString()


def encode_climate_hold(on: bool) -> bytes:
"""Encode a comfort.cabin.set_climate_hold payload."""
action = comfort_pb2.ACTION_ON if on else comfort_pb2.ACTION_OFF
return comfort_pb2.ActionRequest(action=action).SerializeToString()


def encode_pet_mode(on: bool) -> bytes:
"""Encode a comfort.cabin.set_pet_mode payload."""
action = comfort_pb2.ACTION_ON if on else comfort_pb2.ACTION_OFF
return comfort_pb2.ActionRequest(action=action).SerializeToString()


@RVMDecoder.register(CLIMATE_HOLD_SETTING_RVM, comfort_pb2.ClimateHoldSetting)
def decode_climate_hold_setting(m: comfort_pb2.ClimateHoldSetting) -> dict[str, Any]:
"""comfort.cabin.climate_hold_setting — configured climate-hold duration.
Expand Down
12 changes: 12 additions & 0 deletions src/rivian/parallax/proto/comfort.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ message ClimateHoldSetting {
int32 duration = 1; // seconds; empty payload when no hold is set
}

// comfort.cabin.set_climate_hold and comfort.cabin.set_pet_mode; the names
// are the app's
message ActionRequest {
Action action = 1;
}

enum Action {
ACTION_UNSPECIFIED = 0;
ACTION_ON = 1;
ACTION_OFF = 2;
}

// comfort.cabin.climate_hold_status
message ClimateHoldStatus {
ClimateHoldStatusValue status = 1;
Expand Down
78 changes: 41 additions & 37 deletions src/rivian/parallax/proto/comfort_pb2.py

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/rivian/parallax/proto/comfort_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions src/rivian/parallax/proto/security.proto
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,19 @@ enum TosAcceptance {
TOS_NOT_ACCEPTED = 1;
TOS_ACCEPTED = 2;
}

// security.video_monitoring.start_live_streaming
message LiveStreamingRequest {
GearGuardCamera camera = 1;
string device_id = 2; // a label for the viewer; any stable string works
}

enum GearGuardCamera { // the app's camera selector
GEAR_GUARD_CAMERA_UNSPECIFIED = 0;
GEAR_GUARD_CAMERA_FRONT = 1;
GEAR_GUARD_CAMERA_BED = 2;
GEAR_GUARD_CAMERA_LEFT = 3;
GEAR_GUARD_CAMERA_RIGHT = 4;
GEAR_GUARD_CAMERA_REAR = 5;
GEAR_GUARD_CAMERA_INTERIOR = 6;
}
46 changes: 25 additions & 21 deletions src/rivian/parallax/proto/security_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading