Repository: postlund/pyatv (python)

Issue:
HomePod 2 reported as "Model/SW: AudioAccessory6,1, Unknown OS 16.5"
### Describe the bug

I have a HomePod 2 and it is being reported as:
   Model/SW: AudioAccessory6,1, Unknown OS 16.5
Mostly for me it is not being picked up by a script which looks for a match on pyatv.const.OperatingSystem.TvOS

### Error log

_No response_

### How to reproduce the bug?

atvremote scan

### What is expected behavior?

I presume:
   Model/SW: HomePod 2, tvOS 16.5


### Operating System

Linux

### Python

3.9

### pyatv

0.13.0

### Device

HomePod 2, tvOS 16.5

### Additional context

n/A

Pull request description:
device: Add second generation HomePod
Fixes #2060

<a href="https://gitpod.io/#https://github.com/postlund/pyatv/pull/2061"><img src="https://gitpod.io/button/open-in-gitpod.svg"/></a>



Patch:
diff --git a/pyatv/const.py b/pyatv/const.py
index 20912f8f..2dd796e9 100644
--- a/pyatv/const.py
+++ b/pyatv/const.py
@@ -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."""
diff --git a/pyatv/convert.py b/pyatv/convert.py
index d8c330a2..f467bec7 100644
--- a/pyatv/convert.py
+++ b/pyatv/convert.py
@@ -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")
diff --git a/pyatv/support/device_info.py b/pyatv/support/device_info.py
index c47150f7..8cd50099 100644
--- a/pyatv/support/device_info.py
+++ b/pyatv/support/device_info.py
@@ -18,6 +18,7 @@ _MODEL_LIST: Dict[str, DeviceModel] = {
     "AudioAccessory1,1": DeviceModel.HomePod,
     "AudioAccessory1,2": DeviceModel.HomePod,
     "AudioAccessory5,1": DeviceModel.HomePodMini,
+    "AudioAccessory6,1": DeviceModel.HomePodGen2,
 }
 
 


Test patch:
diff --git a/tests/test_convert.py b/tests/test_convert.py
index 9247fc47..9e22c404 100644
--- a/tests/test_convert.py
+++ b/tests/test_convert.py
@@ -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"),
     ],
 )