Add DHCP reservation read and write support - #173
Open
cmadds wants to merge 1 commit into
Open
Conversation
- Expose ip_reserved / reserved_ip attributes on client device_tracker entities - Add eero.set_reservation and eero.delete_reservation services to pin/remove a static IP for a client MAC - Fetch network reservations from the reservations endpoint and match by MAC - Document the services (strings/translations) and a dashboard usage example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for reading and managing DHCP reservations (static IPs) for clients.
Read
Client
device_trackerentities gain two attributes:ip_reserved(bool) — whether the client's current IP is a reservationreserved_ip— the reserved IP, when one existsPopulated by fetching the network's reservations and matching by MAC.
Write
Two new services:
eero.set_reservation(mac,ip,name,target_network) — create/update a reservationeero.delete_reservation(mac,target_network) — remove a reservationDocumented in
services.yaml,strings.json, andtranslations/en.json. The README gains a usage section including a one-tap "reserve" dashboard-button example.Implementation notes
{network}/reservations(same session/API the integration already uses), normalised to handle a bare list or a{data|reservations: [...]}wrapper.set_reservationPOSTs{mac, ip, description};delete_reservationlooks the reservation up by MAC and DELETEs itsurl(falling back to{network}/reservations/{id}).Testing
ip_reserved/reserved_ippopulate correctly across wired + wireless clients (reserved infra vs dynamic devices).eero.set_reservationpins a device andeero.delete_reservationreleases it, with the attribute flipping accordingly.Happy to adjust naming/approach — flagging in particular the reliance on the unofficial reservations endpoint.