Skip to content

Conversation

@adriaan42
Copy link
Contributor

The problem (briefly discussed in #580 (comment)):

  • when moving a device from one plugin instance to another (via instance_aquire_devices, or during dynamic instance_create/instance_destroy), tuning of the device is unapplied (settings reverted back to original) before the new tuning is applied.

This proposal makes the following changes:

  • For device specific tuning via @commands (_(execute|cleanup)_all_device_commands), there is a new argument providing (optionally) the instance from/to which the device is being moved.
  • For @command_(get|set) we can handle all logic in the base plugin class.
    • When un-tuning in the "from" instance, only unapply those settings that are not set in the "to" instance.
    • For the settings that are set in both "from" and "to" instance, apply the new settings without unapplying the old ones, but transfer the proper original value of the setting so that it can be correctly restored.
  • For @command_custom we pass the transfer_instance to the command
    • Command implementation can provide a seamless transfer, or just ignore the new argument, and the current "unapply-then-apply" behavior will remain unchanged.
  • In controller, replace the current calls to _remove_devices_nocheck/_add_devices_nocheck with calls to the new _transfer_device.
  • Adapt the irq plugin, which uses @command_custom, to support seamless device transfer (separate commit).

@adriaan42 adriaan42 force-pushed the adriaan/device-instance-transfer branch from d8ff6ab to 8dac918 Compare February 14, 2025 14:58
adriaan42 added 2 commits May 27, 2025 14:18
Enable the transfer of devices from one instance to another without
(temporarily) unapplying the tuning.

Signed-off-by: Adriaan Schmidt <[email protected]>
@adriaan42 adriaan42 force-pushed the adriaan/device-instance-transfer branch from 8dac918 to a5cfada Compare May 27, 2025 12:18
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.

1 participant