Next release#1683
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis 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. ChangesHA MQTT Device Connections Field
Mobile Responsive Hero Styling
Documentation Structure Updates
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
front/plugins/_publisher_mqtt/mqtt.py (1)
168-171: ⚡ Quick winUpdate MQTT README payload examples to include
device.connections.This change extends the discovery payload contract, but the provided README examples still show
devicewithoutconnections. 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
📒 Files selected for processing (1)
front/plugins/_publisher_mqtt/mqtt.py
| "device": { | ||
| "identifiers": [f"{self.deviceId}_sensor", self.unique_id], | ||
| "manufacturer": "NetAlertX", | ||
| "model": self.model or "Unknown", # Use model if available, else set to 'Unknown' |
There was a problem hiding this comment.
I would have expected another line like
"connections": connections_snippet
here as well?
Summary by CodeRabbit