Skip to content

Commit

Permalink
add mac address to device info
Browse files Browse the repository at this point in the history
  • Loading branch information
maxileith authored and postlund committed Dec 17, 2023
1 parent 0937a7b commit 2da50e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/documentation/atvscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ $ atvscript scan
"xxx"
],
"device_info": {
"mac": "AA:BB:CC:DD:EE:FF",
"model": "Gen4K",
"model_str": "Apple TV 4K",
"operating_system": "TvOS",
Expand All @@ -105,6 +106,7 @@ $ atvscript scan
"xxx"
],
"device_info": {
"mac": "AA:BB:CC:DD:EE:FF",
"model": "Gen3",
"model_str": "Apple TV 3",
"operating_system": "Legacy",
Expand All @@ -131,6 +133,7 @@ $ atvscript scan
"xxx"
],
"device_info": {
"mac": null,
"model": "Unknown",
"model_str": "Unknown",
"operating_system": "Unknown",
Expand Down Expand Up @@ -166,6 +169,7 @@ $ atvscript -s 10.0.10.81 scan
"xxx"
],
"device_info": {
"mac": "AA:BB:CC:DD:EE:FF",
"model": "Gen4K",
"model_str": "Apple TV 4K",
"operating_system": "TvOS",
Expand Down
1 change: 1 addition & 0 deletions pyatv/scripts/atvscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ async def _scan_devices(loop, storage: Storage, hosts):
"identifier": atv.identifier,
"all_identifiers": atv.all_identifiers,
"device_info": {
"mac": atv.device_info.mac,
"model": atv.device_info.model.name,
"model_str": atv.device_info.model_str,
"operating_system": atv.device_info.operating_system.name,
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/test_atvscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async def test_scan_devices(scriptenv, fake_atv):
"identifier": DMAP_ID,
"all_identifiers": [DMAP_ID],
"device_info": {
"mac": None,
"model": "Unknown",
"model_str": "Unknown",
"operating_system": "Legacy",
Expand All @@ -56,6 +57,7 @@ async def test_scan_devices(scriptenv, fake_atv):
"identifier": MRP_ID,
"all_identifiers": [AIRPLAY_ID, MRP_ID],
"device_info": {
"mac": AIRPLAY_ID,
"model": "Unknown",
"model_str": "pyatv",
"operating_system": "TvOS",
Expand Down

0 comments on commit 2da50e9

Please sign in to comment.