christianmanivong a0a43de734
driver / standard (push) Successful in 14s
CI / driver (push) In progress
driver / lint (push) Successful in 13s
driver / types (push) Successful in 52s
driver / test (3.10) (push) Successful in 2m52s
driver / test (3.11) (push) Successful in 2m46s
driver / test (3.12) (push) Successful in 2m44s
driver / security (push) Successful in 51s
driver / build (push) Successful in 27s
driver / lowest (push) Successful in 2m21s
driver / test (3.13) (push) Successful in 2m44s
driver / publish (push) Waiting to run
Merge pull request 'chore: adopt the NAPALM driver standard' (#6) from chore/driver-standard into main
2026-10-23 14:42:36 +00:00
2026-10-23 16:01:56 +02:00
2026-10-23 16:01:56 +02:00

napalm-sonos

NAPALM driver for Sonos speakers, built on napalm-device-types (MediaDriver). It talks to the speaker through SoCo.

Tested against

Model Firmware
not recorded yet

Connection

UPnP/SOAP over HTTP on port 1400, through SoCo. A Sonos speaker takes no login: username and password are accepted for NAPALM's constructor and ignored. open() reads the speaker info once; is_alive() checks that TCP port 1400 accepts a connection.

from napalm import get_network_driver

driver = get_network_driver("sonos")
with driver("192.0.2.20") as speaker:
    print(speaker.get_facts())
    print(speaker.get_playback_state())

Supported

Getter / action
get_facts from the speaker info read at open()
get_interfaces, get_interfaces_ip eth0 when the speaker is wired, always wlan0
get_playback_state, get_current_track yes
get_volume, set_volume, get_mute, set_mute yes
play, pause, stop, next_track, previous_track yes
get_group_info, get_zone_info yes

Not supported

Configuration management (load_replace_candidate and load_merge_candidate raise NotImplementedError), the CLI, and every routing, LLDP, ARP, NTP, SNMP, BGP, user and environment getter: they return empty results.

Installation

pip install napalm-sonos

Development

The rules are in STANDARDS.md.

python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest --cov

License

Apache-2.0

S
Description
No description provided
Readme
79 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 100%