openHASP-custom-component icon indicating copy to clipboard operation
openHASP-custom-component copied to clipboard

Add Dynamic IP Update Logic for openHASP Plate

Open wjnelson78 opened this issue 10 months ago • 0 comments

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:

  1. 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

  1. 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.

wjnelson78 avatar Mar 11 '25 16:03 wjnelson78