Skip to content

hs485d: create the channels of a new device with their channel class - #209

Open
hobbyquaker wants to merge 1 commit into
OpenCCU:mainfrom
hobbyquaker:fix/166-wired-maintenance
Open

hobbyquaker wants to merge 1 commit into
OpenCCU:mainfrom
hobbyquaker:fix/166-wired-maintenance

Conversation

@hobbyquaker

Copy link
Copy Markdown

SetDeviceDescription() built every channel of a device found by a bus search or by its own announcement as a plain HS485Channel and ignored the channel class of the device description. Only a device loaded from its file got its channels through AddChannel(), which creates the class the description names. So channel 0 of a newly learned wired device was no HS485MaintenanceChannel until hs485d was restarted: getValue() of UNREACH, STICKY_UNREACH and CONFIG_PENDING answered false with a warning, and a failed send fired no UNREACH event and left no service message. Rebuild() creates the channels of a device whose type changed the same way.

Both now create the channels with AddChannel(), as the load path does, and fall back to a plain channel if that fails.

Fixes #166

SetDeviceDescription() built every channel of a device found by a bus
search or by its own announcement as a plain HS485Channel and ignored
the channel class of the device description. Only a device loaded from
its file got its channels through AddChannel(), which creates the class
the description names. So channel 0 of a newly learned wired device was
no HS485MaintenanceChannel until hs485d was restarted: getValue() of
UNREACH, STICKY_UNREACH and CONFIG_PENDING answered false with a
warning, and a failed send fired no UNREACH event and left no service
message. Rebuild() creates the channels of a device whose type changed
the same way.

Both now create the channels with AddChannel(), as the load path does,
and fall back to a plain channel if that fails.

Fixes OpenCCU#166
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aea148f1-1b1b-467e-9234-ab646cb3b270
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hs485d: A newly discovered wired device has no working maintenance channel until hs485d restarts

1 participant