Skip to content

Commit b9dffda

Browse files
committed
update auf aktuelle crates
1 parent 47ce0a0 commit b9dffda

4 files changed

Lines changed: 68 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Stream Deck Plugin Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-windows:
10+
name: Build Stream Deck Plugin
11+
runs-on: windows-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v4
18+
19+
- name: Install Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
22+
- name: Rust Cache
23+
uses: Swatinem/rust-cache@v2
24+
25+
- name: Build Binary
26+
run: cargo build --release
27+
28+
- name: Prepare Plugin Folder
29+
shell: pwsh
30+
run: |
31+
# Zielordner erstellen
32+
New-Item -ItemType Directory -Path "de.thatzok.thebus.sdPlugin" -Force
33+
34+
# Binary kopieren
35+
Copy-Item "target/release/thebus-streamdeck-plugin.exe" "de.thatzok.thebus.sdPlugin/"
36+
37+
# Gesamten Inhalt des Assets-Ordners (inkl. manifest.json) kopieren
38+
if (Test-Path "assets") {
39+
Copy-Item -Path "assets/*" -Destination "de.thatzok.thebus.sdPlugin/" -Recurse -Force
40+
}
41+
42+
- name: Create ZIP Archive
43+
shell: pwsh
44+
run: |
45+
Compress-Archive -Path de.thatzok.thebus.sdPlugin -DestinationPath "de.thatzok.thebus.sdPlugin_${{ github.ref_name }}.zip"
46+
47+
- name: Create Release
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
files: "de.thatzok.thebus.sdPlugin_${{ github.ref_name }}.zip"
51+
generate_release_notes: true

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ edition = "2024"
55
rust-version = "1.88"
66
authors = ["ThatZok <af@komplix.de>"]
77
license = "GPL-3.0-or-later"
8-
license-file = "LICENSE"
98

109
[dependencies]
1110
tokio = { version = "1.48.0", features = ["rt", "macros", "rt-multi-thread", "time"] }
1211
rusty-patio = { git = "https://github.com/BButner/rusty-patio" }
1312
serde_json = "1"
14-
the-bus-telemetry = "3.0"
15-
komsi="0.5"
13+
the-bus-telemetry = "4.3"
14+
komsi="1.1"
1615

1716
[features]
1817
# When set, debug log messages are written in the plugin directory

src/main.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -496,34 +496,34 @@ async fn main() {
496496
// lights_warning: 1:on 0:off
497497
// indicator_lamps[0]=blinken_lights;
498498

499-
indicator_lamps[0]=vehicle_state.lights_warning;
499+
indicator_lamps[0]=if vehicle_state.lights_warning { 1 } else { 0 };
500500
indicator_lamps[1]=0;
501501
indicator_lamps[2]=0;
502502

503-
if (vehicle_state.indicator == 1) || (vehicle_state.lights_warning == 1) {
503+
if (vehicle_state.indicator == 1) || (vehicle_state.lights_warning) {
504504
indicator_lamps[1]=blinken_lights;
505505
}
506-
if (vehicle_state.indicator == 2) || (vehicle_state.lights_warning == 1) {
506+
if (vehicle_state.indicator == 2) || (vehicle_state.lights_warning) {
507507
indicator_lamps[2]=blinken_lights;
508508
}
509509

510510
set_indicator_lamps_for_uuid(&mut buttons, UUID_INDICATORS, indicator_lamps, &mut client).await;
511511

512512

513513
set_state_for_uuid(&mut buttons, UUID_INBUS, 1, &mut client).await;
514-
set_state_for_uuid(&mut buttons, UUID_FIXING_BRAKE, vehicle_state.fixing_brake, &mut client).await;
514+
set_state_for_uuid(&mut buttons, UUID_FIXING_BRAKE, if vehicle_state.fixing_brake { 1 } else { 0 }, &mut client).await;
515515

516516
set_gearselect_for_uuid(&mut buttons, UUID_GEARSELECT, vehicle_state.gear_selector, &mut client).await;
517517

518518
// lamps
519-
door_lamps[0]=vehicle_state.doors;
520-
door_lamps[1]=vehicle_state.lights_front_door;
521-
door_lamps[2]=vehicle_state.lights_second_door;
522-
door_lamps[3]=vehicle_state.lights_third_door;
523-
door_lamps[4]=vehicle_state.lights_fourth_door;
519+
door_lamps[0]=if vehicle_state.doors { 1 } else { 0 };
520+
door_lamps[1]=if vehicle_state.lights_front_door { 1 } else { 0 };
521+
door_lamps[2]=if vehicle_state.lights_second_door { 1 } else { 0 };
522+
door_lamps[3]=if vehicle_state.lights_third_door { 1 } else { 0 };
523+
door_lamps[4]=if vehicle_state.lights_fourth_door { 1 } else { 0 };
524524
set_door_lamps_for_uuid(&mut buttons, UUID_PASSENGER_DOORS, door_lamps, &mut client).await;
525525

526-
set_state_for_uuid(&mut buttons, UUID_STOP_BRAKE, vehicle_state.lights_stop_brake, &mut client).await;
526+
set_state_for_uuid(&mut buttons, UUID_STOP_BRAKE, if vehicle_state.lights_stop_brake { 1 } else { 0 }, &mut client).await;
527527

528528
}
529529
}

0 commit comments

Comments
 (0)