Skip to content

fix(virtual): correct device class for e-drive and generator#398

Open
dirkjanfaber wants to merge 3 commits intomasterfrom
fix/virtual-device-class-generator-edrive
Open

fix(virtual): correct device class for e-drive and generator#398
dirkjanfaber wants to merge 3 commits intomasterfrom
fix/virtual-device-class-generator-edrive

Conversation

@dirkjanfaber
Copy link
Collaborator

@dirkjanfaber dirkjanfaber commented Mar 4, 2026

Closes #393
Supersedes #394 (based on @citolen's work — thank you Nils!)

What changed

Virtual e-drive and generator nodes were storing the wrong class in ClassAndVrmInstance in localsettings (using the UI device type e-drive/generator instead of the correct D-Bus types
motordrive/genset/dcgenset).

Commits

  1. fix(virtual): device class for e-drive and generator (Nils Citoleux)
    Extract getDeviceTypeForConfig() helper and use it for the ClassAndVrmInstance default so newly created devices get the correct class from the start.

  2. fix(virtual): lock generator AC/DC type after deployment
    Disable the generator type (AC/DC) selector in the edit dialog once the node has been deployed, preventing a class mismatch between localsettings and the running D-Bus service.

  3. fix(virtual): migrate legacy ClassAndVrmInstance on redeploy
    On startup, detect legacy generator:N / e-drive:N values returned by AddSettings and call SetValue to overwrite them with the correct D-Bus type while preserving the VRM instance number.
    Also updates the now-stale comment in virtual-device-cleanup.js.

@dirkjanfaber dirkjanfaber requested a review from Chris927 March 4, 2026 07:59
@dirkjanfaber dirkjanfaber added bug Use this for bugs including regressions feature labels Mar 4, 2026
@dirkjanfaber dirkjanfaber added this to the v3.80 milestone Mar 4, 2026
@dirkjanfaber dirkjanfaber requested a review from citolen March 4, 2026 07:59
@dirkjanfaber dirkjanfaber force-pushed the fix/virtual-device-class-generator-edrive branch from d0ae112 to e12fa5f Compare March 4, 2026 15:18
@dirkjanfaber dirkjanfaber force-pushed the fix/virtual-device-class-generator-edrive branch from e12fa5f to c1feeef Compare March 4, 2026 15:28
@dirkjanfaber dirkjanfaber requested a review from citolen March 4, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Use this for bugs including regressions feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: wrong device class for E-drives and generators

2 participants