Skip to content

Commit

Permalink
Output all identifiers when scanning with atvscript
Browse files Browse the repository at this point in the history
  • Loading branch information
maxileith authored and postlund committed Dec 17, 2023
1 parent 427c362 commit 0937a7b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
22 changes: 21 additions & 1 deletion docs/documentation/atvscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ $ atvscript scan
"name": "Vardagsrum",
"address": "10.0.10.81",
"identifier": "xxx",
{
"all_identifiers": [
"xxx",
"xxx",
"xxx"
],
"device_info": {
"model": "Gen4K",
"model_str": "Apple TV 4K",
"operating_system": "TvOS",
Expand All @@ -94,6 +99,11 @@ $ atvscript scan
"name": "Apple TV",
"address": "10.0.10.123",
"identifier": "xxx",
"all_identifiers": [
"xxx",
"xxx",
"xxx"
],
"device_info": {
"model": "Gen3",
"model_str": "Apple TV 3",
Expand All @@ -115,6 +125,11 @@ $ atvscript scan
"name": "Proxy",
"address": "10.0.10.254",
"identifier": "xxx",
"all_identifiers": [
"xxx",
"xxx",
"xxx"
],
"device_info": {
"model": "Unknown",
"model_str": "Unknown",
Expand Down Expand Up @@ -145,6 +160,11 @@ $ atvscript -s 10.0.10.81 scan
"name": "Vardagsrum",
"address": "10.0.10.81",
"identifier": "xxx",
"all_identifiers": [
"xxx",
"xxx",
"xxx"
],
"device_info": {
"model": "Gen4K",
"model_str": "Apple TV 4K",
Expand Down
1 change: 1 addition & 0 deletions pyatv/scripts/atvscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ async def _scan_devices(loop, storage: Storage, hosts):
"name": atv.name,
"address": str(atv.address),
"identifier": atv.identifier,
"all_identifiers": atv.all_identifiers,
"device_info": {
"model": atv.device_info.model.name,
"model_str": atv.device_info.model_str,
Expand Down
4 changes: 3 additions & 1 deletion tests/scripts/test_atvscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pyatv.const import Protocol

from tests.scripts.conftest import DMAP_ID, IP_1, IP_2, MRP_ID
from tests.scripts.conftest import AIRPLAY_ID, DMAP_ID, IP_1, IP_2, MRP_ID

_LOGGER = logging.getLogger(__name__)
HASH = "ca496c14642c78af6dd4250191fe175f6dafd72b4c33bcbab43c454aae051da1"
Expand Down Expand Up @@ -41,6 +41,7 @@ async def test_scan_devices(scriptenv, fake_atv):
"name": "Apple TV 1",
"address": IP_1,
"identifier": DMAP_ID,
"all_identifiers": [DMAP_ID],
"device_info": {
"model": "Unknown",
"model_str": "Unknown",
Expand All @@ -53,6 +54,7 @@ async def test_scan_devices(scriptenv, fake_atv):
"name": "Apple TV 2",
"address": IP_2,
"identifier": MRP_ID,
"all_identifiers": [AIRPLAY_ID, MRP_ID],
"device_info": {
"model": "Unknown",
"model_str": "pyatv",
Expand Down

0 comments on commit 0937a7b

Please sign in to comment.