Skip to content

fix(config): reconstruct device object on enable/disable state change#985

Merged
wakonig merged 1 commit into
mainfrom
fix/reconstruct_obj_on_enable
Jun 26, 2026
Merged

fix(config): reconstruct device object on enable/disable state change#985
wakonig merged 1 commit into
mainfrom
fix/reconstruct_obj_on_enable

Conversation

@wakonig

@wakonig wakonig commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

Always reconstruct the device object on enable. This ensures that the device is in a clean state.

Copilot AI review requested due to automatic review settings June 26, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the device-server config update flow so that device enable/disable updates are handled based on state transitions (enabled→disabled / disabled→enabled), reconstructing the device object when a device is re-enabled.

Changes:

  • Track prior enabled state (was_enabled) when applying "enabled" updates.
  • On enabled→disabled: disconnect and reset the device.
  • On disabled→enabled: construct a new device object and initialize it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wakonig wakonig enabled auto-merge (rebase) June 26, 2026 13:59
@wakonig wakonig merged commit ec4b383 into main Jun 26, 2026
83 of 84 checks passed
@wakonig wakonig deleted the fix/reconstruct_obj_on_enable branch June 26, 2026 14:04
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

3 participants