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

Change unique device ID to lowest MAC address #227

Merged
merged 11 commits into from
Oct 5, 2024

Conversation

Snuffy2
Copy link
Collaborator

@Snuffy2 Snuffy2 commented Oct 2, 2024

  • Moves away from the random string generated in OPNsense by the opnsense plugin to the lowest MAC address of the router as the device unique id
  • Stores the device unique id which should prevent duplicate devices or entities from being created
    • Still validates in the data that comes back that it comes from the device with the same MAC address before accepting it
  • Implements Migrate function to automatically update devices, entities and config_entry.
  • Creates both a Minimum Firmware Level where the integration wont install if the firmware is below this and a Limited firmware where it will install but functionality may be limited.
    • Currently min firmware is 24.1 and limited if less than 24.7.
      • Min is 24.1 as the function used to get the MAC addresses from the REST API was first available in 24.1
  • Allow deletion of OPNsense Devices only if there are no entities in the Device (this can be expanded later but starting pretty limited for now)

Fixes #215
Fixes #220

@Snuffy2 Snuffy2 added the enhancement Enhancing existing functionality label Oct 2, 2024
@Snuffy2 Snuffy2 changed the title Change unique device ID to lowest MAc address Change unique device ID to lowest MAC address Oct 2, 2024
@Snuffy2 Snuffy2 marked this pull request as ready for review October 4, 2024 01:04
@Snuffy2 Snuffy2 merged commit ec6a3d4 into travisghansen:main Oct 5, 2024
1 of 2 checks passed
@Snuffy2 Snuffy2 deleted the Change-device_id branch October 5, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config Flow proceeds even if OPNsense address is bad/wrong Upgraded, Now I Have Two Routers?
1 participant