Contract shapes. napalm-device-types' media contract (napalm_device_types/media.py) declares get_playback_state() -> dict (state: "playing"/"paused"/"stopped"/"transitioning", plus source) and get_zone_info() -> list[dict]. The Sonos driver returns a bare string ("PLAYING", "PAUSED_PLAYBACK", "STOPPED", napalm_sonos/sonos_driver.py:317) and a single dict (get_zone_info, line 409).
Swallowed failures.get_group_info (line 385) and get_zone_info end in
exceptException:return{}
so a failed read is reported as "no group" / "no zone". (#9 fixes the same for volume, mute, playback state and track.)
Expected
Both getters follow the device-types contract shape and raise on a failed read (ConnectionException for an unreachable speaker, CommandErrorException for a UPnP error), as #9 does for the others. Test-first with MagicMock(spec=soco.SoCo).
Priority: P4 — netOrk does not call these getters today; any other consumer of the contract gets the wrong shape.
## What happens
1. **Contract shapes.** napalm-device-types' media contract (`napalm_device_types/media.py`) declares `get_playback_state() -> dict` (`state`: `"playing"`/`"paused"`/`"stopped"`/`"transitioning"`, plus `source`) and `get_zone_info() -> list[dict]`. The Sonos driver returns a bare string (`"PLAYING"`, `"PAUSED_PLAYBACK"`, `"STOPPED"`, `napalm_sonos/sonos_driver.py:317`) and a single dict (`get_zone_info`, line 409).
2. **Swallowed failures.** `get_group_info` (line 385) and `get_zone_info` end in
```python
except Exception:
return {}
```
so a failed read is reported as "no group" / "no zone". (#9 fixes the same for volume, mute, playback state and track.)
## Expected
Both getters follow the device-types contract shape and raise on a failed read (`ConnectionException` for an unreachable speaker, `CommandErrorException` for a UPnP error), as #9 does for the others. Test-first with `MagicMock(spec=soco.SoCo)`.
Priority: P4 — netOrk does not call these getters today; any other consumer of the contract gets the wrong shape.
Found during the bug sweep of 2026-11-02 (#9).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
napalm_device_types/media.py) declaresget_playback_state() -> dict(state:"playing"/"paused"/"stopped"/"transitioning", plussource) andget_zone_info() -> list[dict]. The Sonos driver returns a bare string ("PLAYING","PAUSED_PLAYBACK","STOPPED",napalm_sonos/sonos_driver.py:317) and a single dict (get_zone_info, line 409).get_group_info(line 385) andget_zone_infoend inExpected
Both getters follow the device-types contract shape and raise on a failed read (
ConnectionExceptionfor an unreachable speaker,CommandErrorExceptionfor a UPnP error), as #9 does for the others. Test-first withMagicMock(spec=soco.SoCo).Priority: P4 — netOrk does not call these getters today; any other consumer of the contract gets the wrong shape.
Found during the bug sweep of 2026-11-02 (#9).