Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device: Add second generation HomePod #2061

Merged
merged 1 commit into from
Jun 17, 2023
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
3 changes: 3 additions & 0 deletions pyatv/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ class DeviceModel(Enum):
AppleTV4KGen3 = 11
"""Device model is seventh generation Apple TV (Apple TV 4K gen 3)."""

HomePodGen2 = 12
"""Device model is HomePod (second generation)."""


class InputAction(Enum):
"""Type of input when pressing a button."""
Expand Down
5 changes: 3 additions & 2 deletions pyatv/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def model_str(device_model: DeviceModel) -> str:
DeviceModel.HomePodMini: "HomePod Mini",
DeviceModel.AirPortExpress: "AirPort Express (gen 1)",
DeviceModel.AirPortExpressGen2: "AirPort Express (gen 2)",
DeviceModel.AppleTV4KGen2: "Apple TV 4K (gen2)",
DeviceModel.AppleTV4KGen2: "Apple TV 4K (gen 2)",
DeviceModel.Music: "Music/iTunes",
DeviceModel.AppleTV4KGen3: "Apple TV 4K (gen3)",
DeviceModel.AppleTV4KGen3: "Apple TV 4K (gen 3)",
DeviceModel.HomePodGen2: "HomePod (gen 2)",
}.get(device_model, "Unknown")
1 change: 1 addition & 0 deletions pyatv/support/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"AudioAccessory1,1": DeviceModel.HomePod,
"AudioAccessory1,2": DeviceModel.HomePod,
"AudioAccessory5,1": DeviceModel.HomePodMini,
"AudioAccessory6,1": DeviceModel.HomePodGen2,
}


Expand Down
5 changes: 3 additions & 2 deletions tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ def test_protocol_str(protocol, output):
(DeviceModel.HomePodMini, "HomePod Mini"),
(DeviceModel.AirPortExpress, "AirPort Express (gen 1)"),
(DeviceModel.AirPortExpressGen2, "AirPort Express (gen 2)"),
(DeviceModel.AppleTV4KGen2, "Apple TV 4K (gen2)"),
(DeviceModel.AppleTV4KGen2, "Apple TV 4K (gen 2)"),
(DeviceModel.Music, "Music/iTunes"),
(DeviceModel.AppleTV4KGen3, "Apple TV 4K (gen3)"),
(DeviceModel.AppleTV4KGen3, "Apple TV 4K (gen 3)"),
(DeviceModel.HomePodGen2, "HomePod (gen 2)"),
(1234, "Unknown"),
],
)
Expand Down