[wifi-info] Add IP address text sensor - #25
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughA new text_sensor configuration block was added to expose the ESPHome device's IP address using the wifi_info platform. The sensor is named "IP Address" with identifier Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
🧹 Nitpick comments (2)
Integrations/ESPHome/Core.yaml (2)
298-302: Addentity_category: "diagnostic"for consistency.The existing
wifi_signal_dbRSSI sensor (Line 271) carriesentity_category: "diagnostic". The IP address sensor is the same kind of network-diagnostic entity and should be categorized consistently so it lands in the HA Diagnostics section rather than the main entity list.♻️ Proposed fix
text_sensor: - platform: wifi_info ip_address: name: "IP Address" id: wifi_ip + entity_category: "diagnostic"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Integrations/ESPHome/Core.yaml` around lines 298 - 302, Update the wifi IP text sensor block (text_sensor -> platform: wifi_info -> ip_address with id: wifi_ip) to include entity_category: "diagnostic" so it is categorized like the existing wifi_signal_db RSSI sensor; add the entity_category key inside the ip_address sensor definition next to name/id to ensure it appears under Home Assistant Diagnostics.
298-302: Consider usingaddress_0for deterministic IPv4 reporting if IPv6 is enabled.The ESP-IDF framework supports dual-stack IPv4/IPv6. If
network.enable_ipv6is set totrue, the device can obtain multiple IP addresses, and the bareip_addresssensor may surface an IPv6 address instead of IPv4. ESPHome supports up to five address sensors (address_0–address_4) for reporting all addresses. To ensure IPv4 is always reported first, pin the primary sensor toaddress_0.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Integrations/ESPHome/Core.yaml` around lines 298 - 302, The wifi_info text_sensor currently uses the generic ip_address field (text_sensor -> platform: wifi_info -> ip_address with id wifi_ip); update this to use the indexed address_0 sensor instead so the primary IPv4 is reported deterministically when IPv6 is enabled (replace ip_address with address_0 while keeping the name "IP Address" and id wifi_ip).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Integrations/ESPHome/Core.yaml`:
- Around line 298-302: Update the wifi IP text sensor block (text_sensor ->
platform: wifi_info -> ip_address with id: wifi_ip) to include entity_category:
"diagnostic" so it is categorized like the existing wifi_signal_db RSSI sensor;
add the entity_category key inside the ip_address sensor definition next to
name/id to ensure it appears under Home Assistant Diagnostics.
- Around line 298-302: The wifi_info text_sensor currently uses the generic
ip_address field (text_sensor -> platform: wifi_info -> ip_address with id
wifi_ip); update this to use the indexed address_0 sensor instead so the primary
IPv4 is reported deterministically when IPv6 is enabled (replace ip_address with
address_0 while keeping the name "IP Address" and id wifi_ip).
|
@bharvey88 Conflict |
83d014d to
80c1945
Compare
Summary
wifi_infoIP address text sensor toCore.yamlTest plan
Type of change
Checklist
Summary by CodeRabbit