- 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 %).
- open() raises ConnectionException from the SoCo error (B904), so the
cause stays attached.
- _check_wired_connection: the except Exception: pass (B110) now logs at
debug level, so a swallowed failure leaves a trace. A module logger is
new.
- nosec for the empty password default (B107): a Sonos speaker takes no
login, the argument exists for NAPALM's constructor signature.
- tests: raise AssertionError instead of assert False (B011).
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
run_device_action dispatched play, pause, stop, next/previous track,
set_volume:N and toggle_mute by string and returned
{success, action, message} instead of the DeviceActionResultDict its
contract names. The typed methods it called (play(), set_volume(), ...)
are the interface; napalm-device-types deprecates run_device_action.
BREAKING CHANGE: run_device_action is removed.
Closes#3
The same job as napalm-fritzbox and napalm-opnsense: Python 3.10, 3.11 and
3.12, pytest, then wheel and sdist. napalm-device-types comes from
git.netork.io first, because PyPI has an unrelated package of that name.
A Sonos speaker implements none of the access-point surface — no SSIDs, no radio
configuration, no MAC ACL. It has get_playback_state, get_volume, play and
get_zone_info. It inherited AccessPointDriver because nothing better existed,
and netOrk reads that role to decide what belongs in its wireless page and its
AP profile pickers, so a speaker showed up in both.
napalm-device-types now has MediaDriver, which is what this is. TYPE_LABEL
becomes "Media" rather than "Access Point".
Same root cause as netork#117.