Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pyblu/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Preset:

@dataclass
class Input:
id: str
id: str | None
"""Unique id of the input"""
text: str
"""User friendly name of the input"""
Expand Down
2 changes: 1 addition & 1 deletion src/pyblu/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def parse_inputs(response: bytes) -> list[Input]:

inputs = [
Input(
id=x.attrib["id"],
id=x.attrib.get("id"),
text=x.attrib["text"],
image=x.attrib["image"],
url=unquote(x.attrib["URL"]),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ async def test_inputs():
status=200,
body="""
<radiotime service="Capture">
<item typeIndex="bluetooth-1" playerName="Node" text="Bluetooth" inputType="bluetooth" id="input3" URL="Capture%3Abluez%3Abluetooth" image="/images/BluetoothIcon.png" type="audio"/>
<item typeIndex="bluetooth-1" playerName="Node" text="Bluetooth" inputType="bluetooth" URL="Capture%3Abluez%3Abluetooth" image="/images/BluetoothIcon.png" type="audio"/>
<item typeIndex="arc-1" playerName="Node" text="HDMI ARC" inputType="arc" id="input2" URL="Capture%3Ahw%3Aimxspdif%2C0%2F1%2F25%2F2%3Fid%3Dinput2" image="/images/capture/ic_tv.png" type="audio"/>
<item playerName="Node" text="Spotify" id="Spotify" URL="Spotify%3Aplay" image="/Sources/images/SpotifyIcon.png" serviceType="CloudService" type="audio"/>
</radiotime>
Expand All @@ -647,7 +647,7 @@ async def test_inputs():
mocked.assert_called_once()

assert inputs == [
Input(id="input3", text="Bluetooth", image="/images/BluetoothIcon.png", url="Capture:bluez:bluetooth"),
Input(id=None, text="Bluetooth", image="/images/BluetoothIcon.png", url="Capture:bluez:bluetooth"),
Input(id="input2", text="HDMI ARC", image="/images/capture/ic_tv.png", url="Capture:hw:imxspdif,0/1/25/2?id=input2"),
Input(id="Spotify", text="Spotify", image="/Sources/images/SpotifyIcon.png", url="Spotify:play"),
]
Expand Down