Skip to content

Show Floating for Firewall Rules and add Extra State Attr#491

Merged
Snuffy2 merged 1 commit intotravisghansen:mainfrom
Snuffy2:Refine-rule-naming
Feb 7, 2026
Merged

Show Floating for Firewall Rules and add Extra State Attr#491
Snuffy2 merged 1 commit intotravisghansen:mainfrom
Snuffy2:Refine-rule-naming

Conversation

@Snuffy2
Copy link
Collaborator

@Snuffy2 Snuffy2 commented Feb 7, 2026

This pull request enhances the handling and display of firewall and NAT rule switches in the custom_components/opnsense/switch.py file. The main improvements include more accurate naming for NPTv6 NAT rules, improved interface labeling for firewall rules, and expanded extra state attributes for both firewall and NAT rule switches to provide richer information.

Improvements to rule naming and labeling:

  • Updated the naming convention for NPT NAT rules to clarify that they are NPTv6 rules, including docstrings and entity names. [1] [2] [3]
  • Improved interface labeling for firewall rules by marking rules with more than one interface as "Floating" for clarity.

Enhancements to extra state attributes:

  • Expanded the extra state attributes for firewall rule switches to include description, categories, state, action, direction, interfaces, version, protocol, source/destination networks and ports, and gateway.
  • Added dynamic mapping of extra state attributes for NAT rule switches based on the NAT rule type, providing detailed information such as protocol, networks, ports, translation targets, and IPv6 prefixes.

Partially addresses #488

@Snuffy2 Snuffy2 added the bugfix Fix something that isn't working label Feb 7, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  custom_components/opnsense
  switch.py 429, 432, 910-911, 1067-1068
Project Total  

This report was generated by python-coverage-comment-action

@Snuffy2 Snuffy2 force-pushed the Refine-rule-naming branch from d2e32e4 to d9164f1 Compare February 7, 2026 03:32
@Snuffy2 Snuffy2 marked this pull request as ready for review February 7, 2026 03:41
@Snuffy2 Snuffy2 merged commit 44af24d into travisghansen:main Feb 7, 2026
6 checks passed
@Snuffy2 Snuffy2 deleted the Refine-rule-naming branch February 7, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix something that isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant