#2: wired vs. wireless is unknown (option C, as decided)
What changed: the wired check is gone. It read device_properties, which SoCo does not have, and swallowed the AttributeError.
In SoCo 0.31.2, deviceProperties is the UPnP DeviceProperties service. None of its actions says whether a speaker is wired or wireless.
GetZoneInfo returns serial, versions, IP, MAC, HTAudioIn, Flags and ExtraInfo, with no documented meaning for the last two.
EthLink exists only as an evented variable.
What the driver reports now: one interface, wlan0, described as "Network (wired or wireless unknown)". The name is kept so existing interface records stay as they are. It never reports eth0.
Docs: the README and the get_interfaces() docstring say that wired vs. wireless is not known.
Test:test_a_speaker_reports_no_eth0. Red first: the old guess claimed eth0 for a speaker object carrying the WifiMode it looked for.
#11: the media contract's shapes, raising on failed reads
get_playback_state() returns {"state", "source"} as napalm-device-types' MediaDriver declares it.
state maps UPnP's PLAYING, PAUSED_PLAYBACK, STOPPED and TRANSITIONING to the contract's four values. NO_MEDIA_PRESENT counts as stopped.
Any other state (UPnP's recording states) raises CommandErrorException.
source is SoCo's music_source in lower case (radio, line_in, tv, none, …).
get_zone_info() returns [{"name", "coordinator", "members"}] for the speaker's group, with the other speakers listed by name. A speaker in no group gives []. The speaker details it used to return stay in get_facts().
get_group_info() keeps its shape.
Both getters raise like the others since #9:ConnectionClosedException when not connected, ConnectionException / CommandErrorException when the read fails. Before, they answered {}.
Breaking, pre-1.0: the get_playback_state() and get_zone_info() shapes change. The CHANGELOG says so.
netOrk:git grep on netOrk origin/main finds no consumer of the media contract. There are no calls to get_playback_state, get_zone_info or get_group_info, and no import of napalm_device_types.media. netOrk only uses the role key media (device_class, the driver list, tests/test_vendor_drivers.py).
Tests: they use MagicMock(spec=soco.SoCo) and spec=soco.groups.ZoneGroup. Red first: the shape tests, the not-connected cases for both getters, and the failed group reads.
Two fixes, one commit each.
## #2: wired vs. wireless is unknown (option C, as decided)
- **What changed:** the wired check is gone. It read `device_properties`, which SoCo does not have, and swallowed the `AttributeError`.
- In SoCo 0.31.2, `deviceProperties` is the UPnP `DeviceProperties` service. None of its actions says whether a speaker is wired or wireless.
- `GetZoneInfo` returns serial, versions, IP, MAC, `HTAudioIn`, `Flags` and `ExtraInfo`, with no documented meaning for the last two.
- `EthLink` exists only as an evented variable.
- **What the driver reports now:** one interface, `wlan0`, described as "Network (wired or wireless unknown)". The name is kept so existing interface records stay as they are. It never reports `eth0`.
- **Docs:** the README and the `get_interfaces()` docstring say that wired vs. wireless is not known.
- **Test:** `test_a_speaker_reports_no_eth0`. Red first: the old guess claimed `eth0` for a speaker object carrying the `WifiMode` it looked for.
## #11: the media contract's shapes, raising on failed reads
- **`get_playback_state()`** returns `{"state", "source"}` as napalm-device-types' `MediaDriver` declares it.
- `state` maps UPnP's `PLAYING`, `PAUSED_PLAYBACK`, `STOPPED` and `TRANSITIONING` to the contract's four values. `NO_MEDIA_PRESENT` counts as `stopped`.
- Any other state (UPnP's recording states) raises `CommandErrorException`.
- `source` is SoCo's `music_source` in lower case (`radio`, `line_in`, `tv`, `none`, …).
- **`get_zone_info()`** returns `[{"name", "coordinator", "members"}]` for the speaker's group, with the other speakers listed by name. A speaker in no group gives `[]`. The speaker details it used to return stay in `get_facts()`.
- **`get_group_info()`** keeps its shape.
- **Both getters raise like the others since #9:** `ConnectionClosedException` when not connected, `ConnectionException` / `CommandErrorException` when the read fails. Before, they answered `{}`.
- **Breaking, pre-1.0:** the `get_playback_state()` and `get_zone_info()` shapes change. The CHANGELOG says so.
- **netOrk:** `git grep` on netOrk origin/main finds no consumer of the media contract. There are no calls to `get_playback_state`, `get_zone_info` or `get_group_info`, and no import of `napalm_device_types.media`. netOrk only uses the role key `media` (`device_class`, the driver list, `tests/test_vendor_drivers.py`).
- **Tests:** they use `MagicMock(spec=soco.SoCo)` and `spec=soco.groups.ZoneGroup`. Red first: the shape tests, the not-connected cases for both getters, and the failed group reads.
## Checks
No real speaker was used; all tests run on mocks.
| Check | Result |
|---|---|
| pytest | 55 passed |
| ruff format / ruff check | green |
| mypy | green |
| bandit | green |
| `napalm-standard check` / `napalm-standard ratchet` | green |
| coverage | 83.5 % (floor 71) |
Closes #2
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_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
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.
Two fixes, one commit each.
#2: wired vs. wireless is unknown (option C, as decided)
device_properties, which SoCo does not have, and swallowed theAttributeError.devicePropertiesis the UPnPDevicePropertiesservice. None of its actions says whether a speaker is wired or wireless.GetZoneInforeturns serial, versions, IP, MAC,HTAudioIn,FlagsandExtraInfo, with no documented meaning for the last two.EthLinkexists only as an evented variable.wlan0, described as "Network (wired or wireless unknown)". The name is kept so existing interface records stay as they are. It never reportseth0.get_interfaces()docstring say that wired vs. wireless is not known.test_a_speaker_reports_no_eth0. Red first: the old guess claimedeth0for a speaker object carrying theWifiModeit looked for.#11: the media contract's shapes, raising on failed reads
get_playback_state()returns{"state", "source"}as napalm-device-types'MediaDriverdeclares it.statemaps UPnP'sPLAYING,PAUSED_PLAYBACK,STOPPEDandTRANSITIONINGto the contract's four values.NO_MEDIA_PRESENTcounts asstopped.CommandErrorException.sourceis SoCo'smusic_sourcein lower case (radio,line_in,tv,none, …).get_zone_info()returns[{"name", "coordinator", "members"}]for the speaker's group, with the other speakers listed by name. A speaker in no group gives[]. The speaker details it used to return stay inget_facts().get_group_info()keeps its shape.ConnectionClosedExceptionwhen not connected,ConnectionException/CommandErrorExceptionwhen the read fails. Before, they answered{}.get_playback_state()andget_zone_info()shapes change. The CHANGELOG says so.git grepon netOrk origin/main finds no consumer of the media contract. There are no calls toget_playback_state,get_zone_infoorget_group_info, and no import ofnapalm_device_types.media. netOrk only uses the role keymedia(device_class, the driver list,tests/test_vendor_drivers.py).MagicMock(spec=soco.SoCo)andspec=soco.groups.ZoneGroup. Red first: the shape tests, the not-connected cases for both getters, and the failed group reads.Checks
No real speaker was used; all tests run on mocks.
napalm-standard check/napalm-standard ratchetCloses #2
Closes #11
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