rupnp icon indicating copy to clipboard operation
rupnp copied to clipboard

Save optional extra device elements in device spec

Open ryanolf opened this issue 1 year ago • 1 comments

This PR adds a the ability to save custom device properties to the DeviceSpec when the device is instantiated. This is helpful when one wants to to keep more information about a device at hand (no new request required) either without enabling the full_device_spec or when the desired property isn't included in the full spec.

I use this, for example, to load the roomName for Sonos devices at the time of discovery.

The changes here don't impact any of the existing public API -- the new features are accessed by new public functions. The action and signature of existing public functions is unchanged.

ryanolf avatar Oct 25 '24 22:10 ryanolf

I added an example using the new feature, as well as a test for the updated find-xml! macro. I've verified that pre-existing examples run as ever.

ryanolf avatar Oct 25 '24 22:10 ryanolf

Thanks for the PR and sorry for the long wait

jakobhellermann avatar Apr 25 '25 20:04 jakobhellermann