spotifywebapiPython 1.0.243__py3-none-any.whl → 1.0.251__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. spotifywebapipython/const.py +1 -1
  2. spotifywebapipython/docs/__init__.html +56 -2
  3. spotifywebapipython/docs/index.html +5 -2
  4. spotifywebapipython/docs/search.js +1 -1
  5. spotifywebapipython/docs/spotifywebapipython/const.html +3 -3
  6. spotifywebapipython/docs/spotifywebapipython/saappmessages.html +2 -2
  7. spotifywebapipython/docs/spotifywebapipython/sautils.html +2 -2
  8. spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +2 -2
  9. spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +2 -2
  10. spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +2 -2
  11. spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +235 -4
  12. spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +2 -2
  13. spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +2 -2
  14. spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +2 -2
  15. spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +2 -2
  16. spotifywebapipython/models/__init__.py +2 -0
  17. spotifywebapipython/models/episodesimplified.py +41 -0
  18. spotifywebapipython/models/imagepalettecolors.py +111 -0
  19. spotifywebapipython/models/imagevibrantcolors.py +2 -0
  20. spotifywebapipython/models/pageobject.py +1 -0
  21. spotifywebapipython/spotifyclient.py +219 -6
  22. spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +227 -76
  23. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py +2 -2
  24. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonecontrollerlistener.py +247 -0
  25. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonemanagerlistener.py +384 -0
  26. spotifywebapipython/vibrant/__init__.py +2 -0
  27. spotifywebapipython/vibrant/colorthieffast.py +626 -0
  28. {spotifywebapipython-1.0.243.dist-info → spotifywebapipython-1.0.251.dist-info}/METADATA +3 -2
  29. {spotifywebapipython-1.0.243.dist-info → spotifywebapipython-1.0.251.dist-info}/RECORD +32 -29
  30. spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonelistener.py +0 -212
  31. {spotifywebapipython-1.0.243.dist-info → spotifywebapipython-1.0.251.dist-info}/LICENSE +0 -0
  32. {spotifywebapipython-1.0.243.dist-info → spotifywebapipython-1.0.251.dist-info}/WHEEL +0 -0
  33. {spotifywebapipython-1.0.243.dist-info → spotifywebapipython-1.0.251.dist-info}/top_level.txt +0 -0
@@ -1,34 +1,34 @@
1
1
  spotifywebapipython/__init__.py,sha256=SnB5BsUGChYgcZHjhZenqYZkb_v3c8aiAUQLkp4lYSY,1205
2
- spotifywebapipython/const.py,sha256=Ar65PMk51vUTlEJZ8ELDwM2KOIbFLjh4Z8gkQUU3TBU,3739
2
+ spotifywebapipython/const.py,sha256=vuHXK7QI-zQ2OKIQsnVouCiyqehvhtHG1iweYpYswcI,3739
3
3
  spotifywebapipython/saappmessages.py,sha256=KWy4H0ePYARZgtGYc2CHXRY0JOQ0bqr0JuDKRBu-wjA,4645
4
4
  spotifywebapipython/sautils.py,sha256=j3f_Lu3Tb5D7-Gd2rJ2Ep901W-4XDp6Vq6XXVl8DX5I,8098
5
5
  spotifywebapipython/spotifyapierror.py,sha256=23_CYlxWN0BceYYCLpBpunl55vEwPr_wFf34l74xzeA,1855
6
6
  spotifywebapipython/spotifyapimessage.py,sha256=wCnW8jYMLS3x9kjyXPgXXZqaf1HeMTTXzU8u_Dm5pfA,8447
7
7
  spotifywebapipython/spotifyauthtoken.py,sha256=iVg2Pa5mfMqYe4qgc5H8td6JzJlaDqk4vMEhH5LmtfI,9289
8
- spotifywebapipython/spotifyclient.py,sha256=GpSXkAAYIGRgPaCwwCxC-AjTLILwDxhQL9a8zwhaB10,838239
8
+ spotifywebapipython/spotifyclient.py,sha256=IwC_cFLmU27eByRGpEXLU3vEke3Xk6AQz-oA0yQ8RrA,849404
9
9
  spotifywebapipython/spotifydiscovery.py,sha256=cyysxl8PQj9yGHVbaqhSF3SStlrp-NvfGAudM-dDmg0,20290
10
10
  spotifywebapipython/spotifymediatypes.py,sha256=hxpBTBb6YRkRxy4rneinLhGugzfw7NTnm1OZg-r5kMI,989
11
11
  spotifywebapipython/spotifywebapiauthenticationerror.py,sha256=5A0MKvYo3Ypv0ZeSSfLHuFLwzoUUu044bBoUgMfNXNw,3940
12
12
  spotifywebapipython/spotifywebapierror.py,sha256=5cga9213J_nFQ0UX4vSn3dpyinASKTRiH0wAR4nLjvs,3147
13
13
  spotifywebapipython/spotifywebplayertoken.py,sha256=axj1j1lM7COiiZfpElkJRdnk4AmE6bAQcjKshUIz1Nk,35813
14
- spotifywebapipython/docs/__init__.html,sha256=lEM6e3l8NHFxGIfP0I1mBE4VivN6aDZ8W5xbxToIKoc,176742
14
+ spotifywebapipython/docs/__init__.html,sha256=x7YB5DymyG6bNCX9ystm-PtfCWEvsDOsunWKO-jogFI,179562
15
15
  spotifywebapipython/docs/codecopy.js,sha256=ryuoZwLIL03YitjjFzn49UO5ta7-OBos6LNA3qHhFzs,3120
16
- spotifywebapipython/docs/index.html,sha256=1mdYE4H8hB548lG-j_67RbJ6P9ibkZC5vxltN86DM7o,48381
17
- spotifywebapipython/docs/search.js,sha256=GTasYC7KLZNa5qwT8Guy_WGyHgV6h4YRzdCAEaViAus,8842013
16
+ spotifywebapipython/docs/index.html,sha256=g4hThjiGQaOPZ51v6rZ4_xGZyqSd39HwH16qsuP7kyw,48523
17
+ spotifywebapipython/docs/search.js,sha256=vVJxV-eF7SUaWco3odc0ycO6kgC1ZMEZ1XTPJrV8lyk,8944688
18
18
  spotifywebapipython/docs/spotifywebapipython.ico,sha256=YImj39fqqSPSuB2-sMDlUYDd6YwRfQeJRtq4FjwWglg,16410
19
19
  spotifywebapipython/docs/spotifywebapipython_OLD.ico,sha256=YIv5LjcD4bTIJQSOr8jjwbWaeB3QkElRwkTOePiGbZo,14904
20
- spotifywebapipython/docs/spotifywebapipython/const.html,sha256=2wgxyjW5LL09y2aSsr1IuTHa1m1tawVzJLVNTekMu34,59034
21
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=vQgTpZYLCCbbGo3_HxgLPIuBnIhXke3o_7eJDacaiL8,60895
22
- spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256=xunH3gnLkquQ68QWz90DX57R2E8Mi1MFzEKIf6xwZPQ,61063
23
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=La0oQBRauZEvWEOc85h5DH6n4SToQUNoz39raDj1Lys,48054
24
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=miTYE6wBszNZY03wG9kTxKdAUeaZ1PIvgSx_2t5S-E4,59210
25
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=mx_RO3IzphzpCrqGO13drVYNbRC-B-CLyOffe6t_Wi0,59256
26
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=yiFcE8CM_VCFLMq29DV-mKpOKWBE62qzBP3nWQj8u18,1608302
27
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=diDIuxxXU5O-kENp-H5QtAU8zOvqF5mlUfsARz2vdMc,57662
28
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=3aQIXBxhGYBzQYvkbb9ekb0JPa97q1td3E1CJ_KUIfE,52174
29
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=EhsmKV4OUEOzsfJSzGyVV0R7l06DIW8EZSlnJYz-IyQ,50592
30
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=saYlKVXmAXilFYSy_Bqu69t908o2Hfpc0bmhh8sb5n0,62204
31
- spotifywebapipython/models/__init__.py,sha256=UqUPpqOziZuHSJDJXCbgBeICWCFybGqv7uuuN0hvW2E,4344
20
+ spotifywebapipython/docs/spotifywebapipython/const.html,sha256=w7RwV5Jmw7c2R-gSbazf21609l2NZvyZja2-25yx_mk,59034
21
+ spotifywebapipython/docs/spotifywebapipython/saappmessages.html,sha256=o3nelGE4GjAJgFkB2qyt5x75qGVe1qdgkjviX0nLlT0,60895
22
+ spotifywebapipython/docs/spotifywebapipython/sautils.html,sha256=AzRna38FUZv7FkJzK_FIOtfo0F-2zVOzOLAix7aNyZE,61063
23
+ spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html,sha256=BnIzoPW3F_pG3-szn6aWkxjidE1lyTjK7hYXd3MGYXs,48054
24
+ spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html,sha256=eZa0ItDmgx-OaNppLMNy5ELvRQqiJ3yp2-aLuLHrUXQ,59210
25
+ spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html,sha256=ne11dsyAMYs090DwCFF-fw_ClFIO5RW5fvibZVgVCFQ,59256
26
+ spotifywebapipython/docs/spotifywebapipython/spotifyclient.html,sha256=H2aJv_cQOh1EwOyeyQhMip_PkCjZtjmyYo-OEaT1Wss,1634791
27
+ spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html,sha256=KP9CI1CuTv70hCkX553nJmTAZuxVrCRubacK5D488zY,57662
28
+ spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html,sha256=jkRMVUnRz0Sqvdvs1HzBBWfachYU7F5dJJlpfUV8nTY,52174
29
+ spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html,sha256=W_kjkCdZgT7e8M9SUmx9Ap005xWM9MaxSv5wtvUD9mo,50592
30
+ spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html,sha256=0QSbgormhKnDuFTn2zGXBtZIqVNo-sK40te0he2DWwE,62204
31
+ spotifywebapipython/models/__init__.py,sha256=RwRQhUX-6EUs8XvStVFpR8EPwoqIAz9K6ref-28qHKI,4423
32
32
  spotifywebapipython/models/album.py,sha256=U3Pdw0-EL33LdkeiN31fjZ23rlLk6DNGV8jRmZU7EyQ,5170
33
33
  spotifywebapipython/models/albumpagesaved.py,sha256=SBYMhkh5ZsMrRAXl-cm9zsxMDh8gO190ENq6Py2TyGY,2417
34
34
  spotifywebapipython/models/albumpagesimplified.py,sha256=zOqN6blzbXQSgrAraVaxX-SgaunNyqJ2v2bauFPhsVo,2504
@@ -56,17 +56,18 @@ spotifywebapipython/models/episode.py,sha256=EAUbp-HtaDdznDQETjCvlTibeoNmUjk2uBB
56
56
  spotifywebapipython/models/episodepagesaved.py,sha256=S-52Mx3kNPr8T7fXHbVLog86PPTde43fzz9t2fHPJ3c,2457
57
57
  spotifywebapipython/models/episodepagesimplified.py,sha256=L420Ep_QQVBgOf2-4zaQ2zzlp7Zcm0ALHp27jgcTAsI,2526
58
58
  spotifywebapipython/models/episodesaved.py,sha256=vlwpYiCKnEWnYtUIaeIuFD4CWHmzEXi0lDIPfb1OWyk,2775
59
- spotifywebapipython/models/episodesimplified.py,sha256=OgQfQmofakYsNja6zJFTBpKKqTVm3B-P5xwZsVyzWL0,12339
59
+ spotifywebapipython/models/episodesimplified.py,sha256=-0A-6y9NJgDekrQfSY8mfmaVOgJPdxyufr9C_8xhKpA,13689
60
60
  spotifywebapipython/models/explicitcontent.py,sha256=_lma2qEqVkDF_rE8hlG5CJ1qWN3slZ3A3wHEWhY1fUw,2165
61
61
  spotifywebapipython/models/externalids.py,sha256=CsLdAslTyDPK_hU1UepmCOJLe8bXZMUCJeH5xlpm-0o,2223
62
62
  spotifywebapipython/models/externalurls.py,sha256=wFMpa9Yj9c6-XmsnYDoOBWPL54qGaADJAROC-CpW4tc,2729
63
63
  spotifywebapipython/models/followers.py,sha256=W_KUqxuuu1z7uA0AnLCL6g_k2Ruhqa86_kKjOLctaSE,1955
64
64
  spotifywebapipython/models/imageobject.py,sha256=7wgnSlKK90RJksDKpp8jLbteqscAd6mIbT3-oouhPTk,5992
65
- spotifywebapipython/models/imagevibrantcolors.py,sha256=ZcjejU_EBScyTGFPm6Q1kQdUJt_OXW1XHoNAqWIjY0w,7135
65
+ spotifywebapipython/models/imagepalettecolors.py,sha256=00RyzVkhlIN4jHZqFztqM5arB3dmxea1qJdUeJ_aXCo,2951
66
+ spotifywebapipython/models/imagevibrantcolors.py,sha256=iPoSJulDLkCruEiR_hcOBlAjlkb-9UqWrQxPhPWzm2k,7220
66
67
  spotifywebapipython/models/linkedfrom.py,sha256=F387txDtFQyEOP6u8S6DhAlceNhU5GcWrsQ1VQ33nIk,4602
67
68
  spotifywebapipython/models/narrator.py,sha256=8gkYk8YkWX7m0ErDs9pwkWbXKkGmCMCFVPTdF6ONqZA,1522
68
69
  spotifywebapipython/models/owner.py,sha256=RokGhciF6TV43svWzeqyvKClhm1YuT0jW5XTx54ZEsI,4543
69
- spotifywebapipython/models/pageobject.py,sha256=6F50G_aA6rtvTpeyf4yG1rnMRiEFIz-N6lcXgfqtAXQ,11000
70
+ spotifywebapipython/models/pageobject.py,sha256=KEQhaapYL-7eSxc2gHGqZnozBJs3wJ888W1wLZwRCD0,11045
70
71
  spotifywebapipython/models/playeractions.py,sha256=GaqEBcmHev8eoCXb51xt8O9trqeOhIpIysjlKYWOBY0,6564
71
72
  spotifywebapipython/models/playerlastplayedinfo.py,sha256=bR6L0u9X7nlCuz21wyzGvUuDXCyDiUiC9KJfgtNltB4,10939
72
73
  spotifywebapipython/models/playerplaystate.py,sha256=v5uzD-ck6SvMpWASKbXsAHrDC6-uhZglpszVXXLNQ3g,15231
@@ -106,14 +107,16 @@ spotifywebapipython/oauthcli/__init__.py,sha256=K37XTxYAKT0n8otCNzWbjgJ10fAPN4WL
106
107
  spotifywebapipython/oauthcli/authclient.py,sha256=sGnhMFCPaW4KTgeBgHTUhJR3Did-LlR5wTg1uQ4_rT4,54654
107
108
  spotifywebapipython/spotifyconnect/__init__.py,sha256=9Xl5KiJFvWLbsdb4YQ0xmF67i36ybpXCCXrWeNsKEvc,1108
108
109
  spotifywebapipython/spotifyconnect/spotifyconnectdeviceeventargs.py,sha256=35hKa0FAaPgy7W8D6MFXmga667pjwXITo8jSj1TDfE8,1988
109
- spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py,sha256=lVS8cDWEm7esr26NAuJfeb8RfAkmYLtThrB5oZK1hZQ,140602
110
+ spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py,sha256=oMuH0jxaAaR_1XOlTT7FNvnGSTHgLXdOej_6RhzqW3o,149143
110
111
  spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py,sha256=lCALM8X980_pKM4L7k8NaXKXEABd4FuhHyMMB9nLerg,22225
111
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py,sha256=lfojmWPq8SpWiqL3CxFjHxT0VObNk7OnsKIRl7jhgxE,32494
112
+ spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py,sha256=mQ7wyrq6f76vpcebudYKv3aFW9YYBIY3C0CGGFSR4yU,32490
112
113
  spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py,sha256=DCSPmbKPUqKlKpSMvujWBHHKbntXT7_9QkKBgymuTOs,15928
113
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonelistener.py,sha256=uDO2w_GIJI8vnpp9KAxJhz8dNH7PbOJUtW1iQT-DOTI,9365
114
+ spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonecontrollerlistener.py,sha256=AA-XxS6AptJWzyO2zsM9DA5ioCncJBKDTpJkr_aN9IM,12352
115
+ spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonemanagerlistener.py,sha256=k3wMC80Z7jBXYwiw9jq-oixRsum7E_vdHzwEgvcGbiw,18918
114
116
  spotifywebapipython/spotifyconnect/spotifyconnectzeroconfexceptions.py,sha256=aesGauxMoKupdTPR5rL2-rXBC3SEvH_9bQQx2Vh-abs,524
115
117
  spotifywebapipython/spotifyconnect/spotifyconnectzeroconflistener.py,sha256=JJovru9o_ie_i9eYb-eZJlPjM-0TQmqU-q3n9F0U-AE,14561
116
- spotifywebapipython/vibrant/__init__.py,sha256=3O_xwJ59vgxxm7ztGe49Kl4F81nP5aoflDlgQpxjhQA,645
118
+ spotifywebapipython/vibrant/__init__.py,sha256=x3yGfhH0ydjWTSILADuwQXaoLvpkV2EM0T_gyZ5aX38,712
119
+ spotifywebapipython/vibrant/colorthieffast.py,sha256=hMPL1yLeCMj6KXpq5V_Pp8eYkvB_8NlA7w95LRh3f1A,21736
117
120
  spotifywebapipython/vibrant/generator.py,sha256=UFLketHF_gAjjC-VQCP8vCUFCgZEYxqN91m1_IeOtj0,7462
118
121
  spotifywebapipython/vibrant/image.py,sha256=pilFUUKgRWmkG-C9vfdNlBQfs0-_XbQUpXZjq2JbFGY,3082
119
122
  spotifywebapipython/vibrant/main.py,sha256=LQPTYZEnnVecYagXfU7lWc5Ij1pS0h7w6btSw2A7S4c,836
@@ -131,8 +134,8 @@ spotifywebapipython/zeroconfapi/zeroconfgetinfo.py,sha256=APayso_F7lCsdzzrkescgd
131
134
  spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py,sha256=FZJM23HIPJSfhXIC3-EuS1XhawheoG5maSp7__k4yBo,2932
132
135
  spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py,sha256=c5uk8ljsIuBK3w2jahHKQuoWvm245LOjUBitetXx5Mo,2347
133
136
  spotifywebapipython/zeroconfapi/zeroconfresponse.py,sha256=mAPIDj5MG53x8peiScrp7OJblwy_o_Sto4wqE0rGujU,6445
134
- spotifywebapipython-1.0.243.dist-info/LICENSE,sha256=KGcc9g0zwqNLcWnSn_ezv1UtKyhMENFhvtixpxUPNsE,1177
135
- spotifywebapipython-1.0.243.dist-info/METADATA,sha256=auIbRdvzC_vlGc_D2dkOnUXH-KdkeoGzPbbas6mhIc4,11613
136
- spotifywebapipython-1.0.243.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
137
- spotifywebapipython-1.0.243.dist-info/top_level.txt,sha256=jTBLFlijKTesYh2dteAz4vb17qjaqWKeDjpnnwTcrjs,20
138
- spotifywebapipython-1.0.243.dist-info/RECORD,,
137
+ spotifywebapipython-1.0.251.dist-info/LICENSE,sha256=KGcc9g0zwqNLcWnSn_ezv1UtKyhMENFhvtixpxUPNsE,1177
138
+ spotifywebapipython-1.0.251.dist-info/METADATA,sha256=XnIfx4w7IwmNW-ydrnh0RwvfHvZS4-YGt0q05bwVd8E,11643
139
+ spotifywebapipython-1.0.251.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
140
+ spotifywebapipython-1.0.251.dist-info/top_level.txt,sha256=jTBLFlijKTesYh2dteAz4vb17qjaqWKeDjpnnwTcrjs,20
141
+ spotifywebapipython-1.0.251.dist-info/RECORD,,
@@ -1,212 +0,0 @@
1
- # external package imports.
2
- from pychromecast.controllers.multizone import MultizoneController, MultiZoneControllerListener
3
- from pychromecast.dial import MultizoneStatus, get_multizone_status
4
- from pychromecast import Chromecast
5
- import pychromecast
6
- import threading
7
- from uuid import UUID
8
- from zeroconf import Zeroconf
9
-
10
- # our package imports.
11
- from spotifywebapipython.models import SpotifyConnectDevice, ZeroconfDiscoveryResult
12
- # note - cannot reference `SpotifyConnectDirectoryTask` due to circular import!
13
- # from .spotifyconnectdirectorytask import SpotifyConnectDirectoryTask
14
-
15
- # get smartinspect logger reference; create a new session for this module name.
16
- from smartinspectpython.siauto import SIAuto, SILevel, SISession, SIMethodParmListContext, SIColors
17
- import logging
18
-
19
- _logsi:SISession = SIAuto.Si.GetSession(__name__)
20
- if (_logsi == None):
21
- _logsi = SIAuto.Si.AddSession(__name__, True)
22
- _logsi.SystemLogger = logging.getLogger(__name__)
23
-
24
-
25
- class SpotifyConnectZeroconfCastMultiZoneListener(MultiZoneControllerListener):
26
- """
27
- Google Chromecast Zeroconf MultiZone Listener class.
28
-
29
- Listens for Chromecast device multi-zone status updates for devices that
30
- support multi-zone / group functionality.
31
- """
32
-
33
- def __init__(
34
- self,
35
- parentDirectory,
36
- zeroconfInstance:Zeroconf,
37
- zeroconf_RLock:threading.RLock,
38
- castMultizoneController:MultizoneController,
39
- castDevice:Chromecast,
40
- ) -> None:
41
- """
42
- Initializes a new instance of the class.
43
-
44
- Args:
45
- parentDirectory (SpotifyConnectDirectoryTask):
46
- Parent SpotifyConnectDirectoryTask instance.
47
- zeroconfInstance (Zeroconf):
48
- Zeroconf instance used to query zeroconf.
49
- zeroconf_RLock (threading.RLock):
50
- Lock object used to enforce thread-safe updates.
51
- castMultizoneController (MultizoneController)
52
- MultizoneController parent instance.
53
- castDevice (Chromecast):
54
- Chromecast device object.
55
- """
56
- # invoke base class method.
57
- super().__init__()
58
-
59
- # initialize storage.
60
- self._CastMultizoneController:MultizoneController = castMultizoneController
61
- self._CastDevice = castDevice
62
- self._ParentDirectory = parentDirectory
63
- self._ZeroconfInstance:Zeroconf = zeroconfInstance
64
- self._Zeroconf_RLock:threading.RLock = zeroconf_RLock
65
-
66
-
67
- def multizone_member_added(
68
- self,
69
- group_uuid:str,
70
- ) -> None:
71
- """
72
- Called when cast has been added to group identified by group_uuid.
73
- """
74
- # use lock, as multiple threads could be calling this method simultaneously.
75
- with self._Zeroconf_RLock:
76
-
77
- # copy passed parameters to thread-safe storage.
78
- argsGroupUuid:UUID = group_uuid
79
-
80
- apiMethodName:str = "multizone_member_added"
81
- apiMethodParms:SIMethodParmListContext = None
82
-
83
- try:
84
-
85
- # trace.
86
- apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
87
- apiMethodParms.AppendKeyValue("group_uuid", argsGroupUuid)
88
- _logsi.LogMethodParmList(SILevel.Debug, "Chromecast multizone group notification was received for group \"%s\"" % (argsGroupUuid), apiMethodParms, colorValue=SIColors.Lavender)
89
-
90
- # get device instance.
91
- scDevice:SpotifyConnectDevice = self._ParentDirectory._SpotifyConnectDevices.GetDeviceByDiscoveryKey(str(argsGroupUuid))
92
- if (scDevice is None):
93
-
94
- # trace.
95
- _logsi.LogVerbose("Could not find SpotifyConnectDevices instance for Cast Group discovery key: \"%s\"" % (str(argsGroupUuid)), colorValue=SIColors.Lavender)
96
-
97
- else:
98
-
99
- # trace.
100
- _logsi.LogVerbose("Chromecast member device %s was added to multizone group \"%s\"" % (scDevice.Title, self._CastDevice.cast_info.friendly_name), colorValue=SIColors.Lavender)
101
-
102
- # dump the multizone status for the newly added member.
103
- castMultiZoneStatus:MultizoneStatus = get_multizone_status(scDevice.DiscoveryResult.HostIpAddress, self._CastDevice.cast_info.services, self._ZeroconfInstance, 5)
104
- _logsi.LogObject(SILevel.Verbose, "Chromecast member device multizone status: %s [%s] (get_multizone_status)" % (scDevice.Title, scDevice.DiscoveryResult.HostIpTitle), castMultiZoneStatus, colorValue=SIColors.Lavender)
105
-
106
- except Exception as ex:
107
-
108
- # trace.
109
- _logsi.LogException("Unhandled exception occured while processing Chromecast MultiZoneController notification (%s)" % (apiMethodName), ex, logToSystemLogger=False)
110
-
111
- # ignore exception, as nothing can be done about it.
112
-
113
- finally:
114
-
115
- # trace.
116
- _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
117
-
118
-
119
- def multizone_member_removed(
120
- self,
121
- group_uuid,
122
- ) -> None:
123
- """
124
- Called when cast has been removed from group identified by group_uuid.
125
- """
126
- # use lock, as multiple threads could be calling this method simultaneously.
127
- with self._Zeroconf_RLock:
128
-
129
- # copy passed parameters to thread-safe storage.
130
- argsGroupUuid:UUID = group_uuid
131
-
132
- apiMethodName:str = "multizone_member_removed"
133
- apiMethodParms:SIMethodParmListContext = None
134
-
135
- try:
136
-
137
- # trace.
138
- apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
139
- apiMethodParms.AppendKeyValue("group_uuid", argsGroupUuid)
140
- _logsi.LogMethodParmList(SILevel.Debug, "Chromecast multizone group notification was received for group \"%s\"" % (argsGroupUuid), apiMethodParms, colorValue=SIColors.Lavender)
141
-
142
- # get device instance.
143
- scDevice:SpotifyConnectDevice = self._ParentDirectory._SpotifyConnectDevices.GetDeviceByDiscoveryKey(str(argsGroupUuid))
144
- if (scDevice is None):
145
-
146
- # trace.
147
- _logsi.LogVerbose("Could not find SpotifyConnectDevices instance for Cast Group discovery key: \"%s\"" % (str(argsGroupUuid)), colorValue=SIColors.Lavender)
148
-
149
- else:
150
-
151
- # trace.
152
- _logsi.LogVerbose("Chromecast member device %s was removed from multizone group \"%s\"" % (scDevice.Title, self._CastDevice.cast_info.friendly_name), colorValue=SIColors.Lavender)
153
-
154
- except Exception as ex:
155
-
156
- # trace.
157
- _logsi.LogException("Unhandled exception occured while processing Chromecast MultiZoneController notification (%s)" % (apiMethodName), ex, logToSystemLogger=False)
158
-
159
- # ignore exception, as nothing can be done about it.
160
-
161
- finally:
162
-
163
- # trace.
164
- _logsi.LeaveMethod(SILevel.Debug, apiMethodName)
165
-
166
-
167
- def multizone_status_received(
168
- self,
169
- ) -> None:
170
- """
171
- Called when Multizone status has been updated.
172
- """
173
- # use lock, as multiple threads could be calling this method simultaneously.
174
- with self._Zeroconf_RLock:
175
-
176
- # copy passed parameters to thread-safe storage.
177
- # n/a
178
-
179
- apiMethodName:str = "multizone_status_received"
180
- apiMethodParms:SIMethodParmListContext = None
181
-
182
- try:
183
-
184
- # trace.
185
- apiMethodParms = _logsi.EnterMethodParmList(SILevel.Debug, apiMethodName)
186
- _logsi.LogMethodParmList(SILevel.Debug, "Chromecast multizone group status has been updated", apiMethodParms, colorValue=SIColors.Lavender)
187
-
188
- # trace.
189
- if (_logsi.IsOn(SILevel.Verbose)):
190
-
191
- # build member list with friendly names.
192
- result:list[str] = []
193
- member:str = None
194
- for member in self._CastMultizoneController.members:
195
- scDevice:SpotifyConnectDevice = self._ParentDirectory._SpotifyConnectDevices.GetDeviceByDiscoveryKey(member)
196
- if (scDevice is None):
197
- result.append(member)
198
- else:
199
- result.append(scDevice.Title)
200
- _logsi.LogArray(SILevel.Verbose, "Chromecast multizone group \"%s\" members (count=%d)" % (self._CastDevice.cast_info.friendly_name, len(result)), result, colorValue=SIColors.Lavender)
201
-
202
- except Exception as ex:
203
-
204
- # trace.
205
- _logsi.LogException("Unhandled exception occured while processing Chromecast MultiZoneController notification (%s)" % (apiMethodName), ex, logToSystemLogger=False)
206
-
207
- # ignore exception, as nothing can be done about it.
208
-
209
- finally:
210
-
211
- # trace.
212
- _logsi.LeaveMethod(SILevel.Debug, apiMethodName)