openHASP-custom-component
openHASP-custom-component copied to clipboard
Add Dynamic IP Update Logic for openHASP Plate
Pull Request Description:
This PR enables the openHASP integration to detect and update the device’s IP address whenever the plate reports a new one in its statusupdate message. Specifically:
- Checks for "ip" in the MQTT payload
• If found, stores the new IP in Home Assistant’s config entry data (async_update_entry)
• Also updates the plate’s device registry entry (async_update_device), so the device “Link” in HA points to the current IP address
- Prevents stale IP references
• Ensures the plate entity, device registry link, and UI references are always in sync with the actual device IP
These changes improve reliability in environments where the plate’s IP might change over time (e.g., DHCP lease expirations, new IP assignments), eliminating the need for manual URL updates.