fix(driver): leave get_interfaces_ip and cli to NAPALM's stubs
driver / standard (pull_request) Successful in 22s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m3s
driver / test (3.12) (pull_request) Successful in 4m13s
driver / test (3.13) (pull_request) Successful in 4m5s
driver / lowest (pull_request) Successful in 3m38s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m19s
CI / driver (pull_request) Successful in 6m10s
driver / publish (pull_request) Skipped

get_interfaces_ip reported the speaker's address with a prefix length
of 24 it never read: the speaker info has no netmask, and SoCo offers
no reading for one, so a speaker in a /23 or /25 network was reported
wrongly. cli answered [] -- not even NAPALM's dict shape -- for a
speaker that has no CLI. Both overrides are gone; NAPALM's stubs raise
NotImplementedError.

Closes #15
This commit is contained in:
Christian Manivong committed 2026-11-12 19:23:25 +01:00
1 parent bb55884216
commit 397917a174
4 files changed
+23 -27

No files matched your search

-18
View File
@@ -153,20 +153,6 @@ class SonosDriver(MediaDriver):
}
return interfaces
def get_interfaces_ip(self) -> dict[str, dict[str, Any]]:
"""Return the speaker's address, on its one connection (see :meth:`get_interfaces`)."""
if not self._speaker_info:
return {}
info = self._speaker_info
ip = info.get("ip_address", self.hostname)
ipv4_entry = {
ip: {
"prefix_length": 24,
}
}
return {_INTERFACE: {"ipv4": ipv4_entry, "ipv6": {}}}
def ping(
self,
destination: str,
@@ -197,10 +183,6 @@ class SonosDriver(MediaDriver):
"error": "Not supported on Sonos",
}
def cli(self, commands: list[str]) -> list[dict[str, Any]]:
"""Run CLI commands (not supported on Sonos)."""
return []
def commit_config(self) -> None:
"""Commit the candidate config (no-op on Sonos)."""
pass