fix(virtual): correct device class for e-drive and generator#398
Open
dirkjanfaber wants to merge 3 commits intomasterfrom
Open
fix(virtual): correct device class for e-drive and generator#398dirkjanfaber wants to merge 3 commits intomasterfrom
dirkjanfaber wants to merge 3 commits intomasterfrom
Conversation
citolen
reviewed
Mar 4, 2026
d0ae112 to
e12fa5f
Compare
e12fa5f to
c1feeef
Compare
citolen
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ClassAndVrmInstancein localsettings (using the UI device typee-drive/generatorinstead of the correct D-Bus typesmotordrive/genset/dcgenset).Commits
fix(virtual): device class for e-drive and generator (Nils Citoleux)
Extract
getDeviceTypeForConfig()helper and use it for theClassAndVrmInstancedefault so newly created devices get the correct class from the start.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.
fix(virtual): migrate legacy ClassAndVrmInstance on redeploy
On startup, detect legacy
generator:N/e-drive:Nvalues returned byAddSettingsand callSetValueto 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.