Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seamless transfer of devices between plugin instances #750

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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).

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 d8ff6ab to 8dac918 Compare February 14, 2025 14:58
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