Repository navigation
Conversation
Send the configuration of a device stored on the CCU (EEPROM cache, paramsets and links) to the device again, like rfd's restoreConfigToDevice. It reuses GetConfig() and RestoreConfig(), which hs485d already uses to restore the configuration of a replaced device. Untested on Wired hardware.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
This was referenced Oct 18, 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.
Warning
Untested – hardware test required. This change has only been compiled. It has not been run with HomeMatic Wired (HMW) devices. Please do not merge before it has been tested on real Wired hardware (see the test plan below).
Interface.restoreConfigToDevice(Restore Configbutton of the device parameters page, #214) is only implemented by rfd (BidCos-RF,src/rfd/XmlRpcMethods.cpp). hs485d (BidCos-Wired) does not register the XML-RPC method, so #216 currently shows the button only forBidCos-RFdevices.hs485d already has the functionality internally. When a device is replaced,
HS485Manager::ReplaceDevice()callsHS485Device::Rebuild(true, false), which:GetConfig()(paramsets and links from the EEPROM cache, which hs485d saves in the.devfiles on the CCU);RestoreConfig().This PR exposes that as an XML-RPC method:
HS485Device::RestoreConfigToDevice():GetConfig()and thenRestoreConfig(config, false), the same arguments as the replace path, followed byRequestSave().HS485Manager::RestoreConfigToDevice(address): looks up the device of the address, likeClearConfigCache(). It throwsUnknown instance(-2) for an unknown address.XmlRpcMethodRestoreConfigToDevice(restoreConfigToDevice(String address)), registered next toclearConfigCache. It throwsFailurewhen the restore fails, like rfd.Line endings (CRLF/LF per file and line) and encodings are preserved.
Risks to check on hardware
RestoreConfig()was written for a replaced, i.e. blank, device. For a device that is already configured:AddLinkPeer(). It has to be checked whether existing links are duplicated or whetherAddLinkPeer()fails. In the second case the restore stops in the middle and leaves a partly written configuration.HS485Channel::GetConfig()leaves out theVALUESparamset, butHS485Channel::RestoreConfig()writes all paramsets exceptLINK, so it also callsPutParamsetValues("VALUES", …)with an empty struct. This seems to work in the replace path, but should be checked as well.Test plan (Wired hardware)
MASTERand link parameters.restoreConfigToDevicefor the device address (XML-RPC on port 2000, or the WebUI button once the gate inic_deviceparameters.cgialso allowsBidCos-Wired).LOG_ALL) forHS485Channel::RestoreConfig()errors. Check thatgetParamsetandgetLinksreturn the same values and links as before (no duplicate links), and that the device still behaves as configured.If this works, the WebUI gate of #216 can allow
BidCos-Wiredagain ($iface eq $HMRFIdentifier || $iface eq "BidCos-Wired"); that is not part of this PR.Validation
x86_64-linux-gnupreset (BUILD_HS485D=ONonly): compiles without warnings.git diff --check(withcr-at-eol) is clean.Generated by Claude Code