From 94496d5d4b8f59327e9681742b04d82fdd72a94f Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sat, 27 Jun 2026 20:20:37 +0200 Subject: [PATCH] refs(models): deprecate unused ZoneRequest member helpers (refs #511) RemoveMember, ClearMembers and HasMember have no production callers: the zone remove paths now use /removeZoneSlave instead of a /setZone rebuild, and standalone is done by dissolving the zone. Mark them Deprecated ahead of removal in the next commit (keeps history legible). Co-Authored-By: Claude Opus 4.8 --- pkg/models/zone.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkg/models/zone.go b/pkg/models/zone.go index 8244da2..58cd4b4 100644 --- a/pkg/models/zone.go +++ b/pkg/models/zone.go @@ -86,7 +86,11 @@ func (zr *ZoneRequest) AddMemberByDeviceID(deviceID string) { zr.Members = append(zr.Members, member) } -// RemoveMember removes a device from the zone configuration +// RemoveMember removes a device from the zone configuration. +// +// Deprecated: unused. Zone members are removed with the /removeZoneSlave +// endpoint (client.RemoveZoneSlave), not by rebuilding the zone via /setZone, so +// this helper has no callers. To be removed. See #511. func (zr *ZoneRequest) RemoveMember(deviceID string) { for i, member := range zr.Members { if member.DeviceID == deviceID { @@ -96,12 +100,18 @@ func (zr *ZoneRequest) RemoveMember(deviceID string) { } } -// ClearMembers removes all members from the zone (creates standalone configuration) +// ClearMembers removes all members from the zone (creates standalone configuration). +// +// Deprecated: unused. To make a device standalone, dissolve the zone instead +// (client.DissolveZone, i.e. NewZoneRequest(master) with no members). To be +// removed. See #511. func (zr *ZoneRequest) ClearMembers() { zr.Members = []MemberEntry{} } -// HasMember checks if a device is in the zone configuration +// HasMember checks if a device is in the zone configuration. +// +// Deprecated: unused. To be removed. See #511. func (zr *ZoneRequest) HasMember(deviceID string) bool { for _, member := range zr.Members { if member.DeviceID == deviceID {