Commit 17cdb45
authored
fix: decode PassengerSeatBelt as BuckleStatus enum, not a bool (#37)
* fix: decode PassengerSeatBelt as BuckleStatus enum, not a bool
make_bool's string handling only ever recognizes the literal "true",
so wrapping the BuckleStatus-valued PassengerSeatBelt signal in
make_bool silently turned every real state (Unlatched/Latched/
Faulted/SNA) into a permanent false. Decode it via BuckleStatus.get,
matching the lookup-map pattern already used by
listen_DetailedChargeState. This is a breaking change: the callback
type changes from bool to str.
Also corrected both seat belt docstrings against live telemetry:
PassengerSeatBelt reports the 2nd row centre belt, not the front
passenger; DriverSeatBelt is true only when the driver seat is
occupied and its belt is undone (the safety-warning condition), not
raw belt state. Removed the stale "# BuckleStatus?" comment, which
sat on the driver listener (a plain bool) instead of the passenger
one.
Swept the rest of vehicle.py's make_bool call sites for other
enum-valued fields wrapped this way; none of the other Signal names
match a defined TeslemetryEnum, so this appears to be the only
instance of the defect.
Bumped to 0.12.0 (minor, matching this project's pre-1.0 convention
for breaking changes - see the prefer_typed removal in 0.11.0) and
regenerated uv.lock.
* chore: bump to 0.11.1 (patch), not 0.12.0 - bugfix to previously-broken field1 parent 423e101 commit 17cdb45
4 files changed
Lines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | | - | |
| 600 | + | |
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
1301 | 1302 | | |
1302 | 1303 | | |
1303 | 1304 | | |
1304 | | - | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
1305 | 1310 | | |
1306 | 1311 | | |
1307 | | - | |
| 1312 | + | |
1308 | 1313 | | |
1309 | 1314 | | |
1310 | 1315 | | |
| |||
1946 | 1951 | | |
1947 | 1952 | | |
1948 | 1953 | | |
1949 | | - | |
| 1954 | + | |
1950 | 1955 | | |
1951 | | - | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
1952 | 1961 | | |
1953 | 1962 | | |
1954 | | - | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
1955 | 1966 | | |
1956 | 1967 | | |
1957 | 1968 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments