Skip to content

Next release#1683

Merged
jokob-sk merged 6 commits into
mainfrom
next_release
Jun 20, 2026
Merged

Next release#1683
jokob-sk merged 6 commits into
mainfrom
next_release

Conversation

@jokob-sk

@jokob-sk jokob-sk commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Improved Home Assistant discovery for sensors and binary sensors by adding MAC-based connection metadata to device details for more reliable identification.
  • Style
    • Added responsive “Mobile” styling for the hero section on small screens, including stacked layout, centered content, and responsive logo/image sizing.
  • Documentation
    • Updated the REST import guide with a direct link to an OPNsense configuration reference.
    • Reorganized documentation navigation to group related guides under a new “Other guides” section.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ef6b9640-2101-4296-8d50-79626b12d3bf

📥 Commits

Reviewing files that changed from the base of the PR and between b6c8f9b and 39cdbfc.

📒 Files selected for processing (2)
  • front/plugins/_publisher_mqtt/mqtt.py
  • front/plugins/rest_import/README.md
✅ Files skipped from review due to trivial changes (1)
  • front/plugins/rest_import/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • front/plugins/_publisher_mqtt/mqtt.py

📝 Walkthrough

Walkthrough

This PR includes three independent changes: extending the Home Assistant MQTT discovery payload to include MAC address connections for device identification, adding mobile-responsive styling for the hero section on narrow viewports, and reorganizing the site documentation navigation to consolidate guides into an "Other guides" section alongside a new documentation reference link in the REST import plugin guide.

Changes

HA MQTT Device Connections Field

Layer / File(s) Summary
Add MAC address to MQTT discovery device object
front/plugins/_publisher_mqtt/mqtt.py
The "device" section in sensor_config.initialize_message() gains a conditional "connections" list containing ["mac", self.mac] when MAC address is available, alongside the existing "name": self.deviceName field for binary_sensor and sensor config types.

Mobile Responsive Hero Styling

Layer / File(s) Summary
Mobile responsive hero section styling
docs/stylesheets/custom.css
New @media query for viewports up to 768px redefines hero layout, stacking flex direction to column-reverse, centering content, expanding hero-content and hero-image to full width, and adjusting hero-logo-crisp sizing constraints.

Documentation Structure Updates

Layer / File(s) Summary
Plugin documentation reference
front/plugins/rest_import/README.md
Added a link to the OPNsense configuration guide immediately under the "Example: OPNsense Dnsmasq API" section for additional reference.
Site navigation reorganization
mkdocs.yml
Removed Pi-hole Guide, Home Assistant, Emails, and Webhooks (n8n) from scattered nav locations and consolidated them into a new "Other guides" subsection alongside Rest import.

🐇 A MAC hops in for Home Assistant's view,
The hero shrinks down when screens are too few,
And guides find their home in a place of their own,
Three changes, one PR — so neat and well-grown! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Next release' is vague and generic, failing to describe the specific changes in this pull request (MQTT device connections, mobile responsive styles, documentation reorganization). Use a more descriptive title that reflects the main changes, such as 'Add MQTT device connections and improve mobile responsiveness' or 'Reorganize docs and enhance MQTT device configuration'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next_release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
front/plugins/_publisher_mqtt/mqtt.py (1)

168-171: ⚡ Quick win

Update MQTT README payload examples to include device.connections.

This change extends the discovery payload contract, but the provided README examples still show device without connections. Updating those examples avoids integration confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@front/plugins/_publisher_mqtt/mqtt.py` around lines 168 - 171, The MQTT
discovery payload now includes a connections field within the device object (as
shown in the diff with the "mac" connection entry), but the README examples
still show the device object without the connections field. Update all MQTT
discovery payload examples in the README file to include the device.connections
array with the appropriate connection type and value to match the actual
implementation, ensuring the documentation reflects the current contract and
prevents integration confusion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@front/plugins/_publisher_mqtt/mqtt.py`:
- Around line 169-171: The `connections` field containing the MAC address is
unconditionally included in the MQTT payload, but when `create_generic_device()`
calls `create_sensor()` without providing a MAC argument, `self.mac` becomes an
empty string, which can cause Home Assistant discovery to reject the payload.
Modify the code around line 169 where `connections` is added to make it
conditional: only include the `connections` field if `self.mac` is non-empty and
valid. Consider normalizing the MAC address using `normalize_mac()` before
inclusion, following the pattern established elsewhere in the codebase with
`DeviceInstance` and `authoritative_handler`.

---

Nitpick comments:
In `@front/plugins/_publisher_mqtt/mqtt.py`:
- Around line 168-171: The MQTT discovery payload now includes a connections
field within the device object (as shown in the diff with the "mac" connection
entry), but the README examples still show the device object without the
connections field. Update all MQTT discovery payload examples in the README file
to include the device.connections array with the appropriate connection type and
value to match the actual implementation, ensuring the documentation reflects
the current contract and prevents integration confusion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f10ae65-5d6e-45ef-b6d1-7e8e9dfb3388

📥 Commits

Reviewing files that changed from the base of the PR and between 112f0fd and cb3c8b7.

📒 Files selected for processing (1)
  • front/plugins/_publisher_mqtt/mqtt.py

Comment thread front/plugins/_publisher_mqtt/mqtt.py Outdated
@jokob-sk jokob-sk merged commit 7e237b0 into main Jun 20, 2026
6 checks passed
"device": {
"identifiers": [f"{self.deviceId}_sensor", self.unique_id],
"manufacturer": "NetAlertX",
"model": self.model or "Unknown", # Use model if available, else set to 'Unknown'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would have expected another line like

"connections": connections_snippet

here as well?

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.

2 participants