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
get_config() overrode NAPALM's stub with `return {}` and took no
arguments, so get_config(retrieve="running") raised TypeError, which a
caller reports as a failed configuration backup on every poll. The
other getters a speaker has nothing for (environment, optics, routing,
ARP, MAC table, LLDP, NTP, SNMP, BGP, probes, users, network instances,
firewall policies) had the same shape: an empty answer reads as
"implemented, nothing there", and get_route_to() required an argument
NAPALM defaults.
All of them are gone; NAPALM's stubs raise NotImplementedError.
Closes#13
get_playback_state returned SoCo's transport string and get_zone_info
the speaker's details, where napalm-device-types' MediaDriver declares
{"state", "source"} and a list of {"name", "coordinator", "members"}.
Both now return those shapes; the speaker's details stay in get_facts.
get_group_info and get_zone_info caught every exception and answered
{}, so a failed read looked like a speaker in no group. They now raise
like the other getters (#9); {} and [] mean no group.
Closes#11
The wired check read device_properties, which SoCo does not have
(deviceProperties is the UPnP service, and none of its actions says
wired or wireless), and swallowed the AttributeError, so eth0 was never
reported and the guess served nothing. It is gone: a speaker reports
its one connection as wlan0, described as of unknown medium, and the
README and the getter docstrings say that wired vs. wireless is not
known.
Closes#2
get_volume, get_mute, get_playback_state and get_current_track
answered 0, False, "STOPPED" and {} when the driver was not connected
or the read failed, so an unreachable speaker looked like a silent,
stopped one. They now raise ConnectionClosedException, or
ConnectionException / CommandErrorException with the SoCo error as
the cause.
get_playback_state called get_playback_state() on the SoCo object,
which SoCo does not have; the AttributeError was swallowed and every
speaker read as STOPPED. It now reads current_transport_state from
get_current_transport_info(). The tests mock the speaker with
MagicMock(spec=soco.SoCo), so a call to a method SoCo lacks fails.
Closes#9
play() and the other controls returned silently without a device, so
a control that did nothing looked like it had worked. They now raise
ConnectionClosedException. get_arp_table() takes NAPALM's vrf
argument, and the module docstring moves above the imports so
__doc__ is set again.
The wired-speaker part of the issue stays open: SoCo's
deviceProperties is a UPnP service, not a dict with WifiMode, so
renaming the attribute alone would still never report eth0.
Refs #2
netOrk runs every driver in its own containers on Python 3.12, so 3.10
and 3.11 are no longer supported or tested. requires-python, mypy and
ruff move to 3.12, along with what ruff's pyupgrade rules then rewrite.
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
of NAPALM/driver-standard; .github/ is gone.
- napalm-device-types >=4.21.1 is now declared: the driver imports
MediaDriver, PortSpec and FingerprintRule from it, and CI used to
install it by hand.
- requires-python >=3.10 (napalm-device-types needs it), LICENSE, README,
CHANGELOG, py.typed, SPDX license string, setuptools>=77, version floors
on the dev extra, links to git.netork.io; .gitignore as in the template.
- mypy strict for the package; napalm_sonos.sonos_driver is exempt for now
(5 errors, two of them return types that differ from MediaDriver's),
recorded in the quality baseline.
- Coverage floor 71 % (measured 71.30 %).