devialet 1.4.4__tar.gz → 1.4.5__tar.gz
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.
- {devialet-1.4.4 → devialet-1.4.5}/PKG-INFO +2 -2
- {devialet-1.4.4 → devialet-1.4.5}/devialet/devialet_api.py +28 -28
- {devialet-1.4.4 → devialet-1.4.5}/devialet.egg-info/PKG-INFO +2 -2
- {devialet-1.4.4 → devialet-1.4.5}/setup.py +2 -2
- {devialet-1.4.4 → devialet-1.4.5}/LICENSE +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/README.md +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/devialet/__init__.py +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/devialet/const.py +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/devialet.egg-info/SOURCES.txt +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/devialet.egg-info/dependency_links.txt +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/devialet.egg-info/requires.txt +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/devialet.egg-info/top_level.txt +0 -0
- {devialet-1.4.4 → devialet-1.4.5}/setup.cfg +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: devialet
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.5
|
|
4
4
|
Summary: Devialet API
|
|
5
5
|
Home-page: https://github.com/fwestenberg/devialet
|
|
6
6
|
Download-URL: https://github.com/fwestenberg/devialet/releases/latest
|
|
7
7
|
Author: fwestenberg
|
|
8
8
|
Author-email:
|
|
9
9
|
License: MIT
|
|
10
|
-
Keywords:
|
|
10
|
+
Keywords: Devialet,Home-Assistant
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Topic :: Software Development :: Build Tools
|
|
@@ -168,8 +168,9 @@ class DevialetApi:
|
|
|
168
168
|
source_type = source["type"]
|
|
169
169
|
device_id = source["deviceId"]
|
|
170
170
|
|
|
171
|
-
if self.device_role in SPEAKER_POSITIONS and (
|
|
172
|
-
|
|
171
|
+
if self.device_role in SPEAKER_POSITIONS and source_type in (
|
|
172
|
+
"optical",
|
|
173
|
+
"opticaljack",
|
|
173
174
|
):
|
|
174
175
|
# Stereo devices have the role FrontLeft or FrontRight.
|
|
175
176
|
# Add a suffix to the source to recognize the device.
|
|
@@ -264,16 +265,16 @@ class DevialetApi:
|
|
|
264
265
|
source_type == "optical" or source_type == "opticaljack"
|
|
265
266
|
) and self.device_role in SPEAKER_POSITIONS:
|
|
266
267
|
for role, position in SPEAKER_POSITIONS.items():
|
|
267
|
-
if (
|
|
268
|
+
if (
|
|
269
|
+
device_id == self.device_id and role == self.device_role
|
|
270
|
+
) or (
|
|
268
271
|
device_id != self.device_id and role != self.device_role
|
|
269
272
|
):
|
|
270
273
|
source_type = source_type + "_" + position
|
|
271
|
-
|
|
272
|
-
break
|
|
274
|
+
return source_type
|
|
273
275
|
except (KeyError, TypeError):
|
|
274
276
|
return None
|
|
275
|
-
|
|
276
|
-
return source_type
|
|
277
|
+
return None
|
|
277
278
|
|
|
278
279
|
@property
|
|
279
280
|
def night_mode(self) -> bool | None:
|
|
@@ -370,7 +371,6 @@ class DevialetApi:
|
|
|
370
371
|
|
|
371
372
|
async def async_set_equalizer(self, preset: str) -> None:
|
|
372
373
|
"""Set the equalizer preset."""
|
|
373
|
-
|
|
374
374
|
await self.post_request(
|
|
375
375
|
UrlSuffix.EQUALIZER,
|
|
376
376
|
{"preset": preset},
|
|
@@ -394,24 +394,26 @@ class DevialetApi:
|
|
|
394
394
|
name_split = name.split("_")
|
|
395
395
|
|
|
396
396
|
for role, position in SPEAKER_POSITIONS.items():
|
|
397
|
-
if position
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
397
|
+
if position != name_split[1]:
|
|
398
|
+
continue
|
|
399
|
+
|
|
400
|
+
if role == self.device_role:
|
|
401
|
+
for _source in self._sources["sources"]:
|
|
402
|
+
if (
|
|
403
|
+
_source["deviceId"] == self.device_id
|
|
404
|
+
and _source["type"] == name_split[0]
|
|
405
|
+
):
|
|
406
|
+
source_id = _source["sourceId"]
|
|
407
|
+
break
|
|
408
|
+
else:
|
|
409
|
+
for _source in self._sources["sources"]:
|
|
410
|
+
if (
|
|
411
|
+
_source["deviceId"] != self.device_id
|
|
412
|
+
and _source["type"] == name_split[0]
|
|
413
|
+
):
|
|
414
|
+
source_id = _source["sourceId"]
|
|
415
|
+
break
|
|
416
|
+
break
|
|
415
417
|
else:
|
|
416
418
|
for _source in self._sources["sources"]:
|
|
417
419
|
if _source["type"] == name:
|
|
@@ -427,7 +429,6 @@ class DevialetApi:
|
|
|
427
429
|
|
|
428
430
|
async def get_request(self, suffix=str) -> any | None:
|
|
429
431
|
"""Generic GET method."""
|
|
430
|
-
|
|
431
432
|
url = "http://" + self._host + str(suffix)
|
|
432
433
|
|
|
433
434
|
try:
|
|
@@ -469,7 +470,6 @@ class DevialetApi:
|
|
|
469
470
|
|
|
470
471
|
async def post_request(self, suffix=str, body=str) -> any | None:
|
|
471
472
|
"""Generic POST method."""
|
|
472
|
-
|
|
473
473
|
url = "http://" + self._host + str(suffix)
|
|
474
474
|
|
|
475
475
|
try:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: devialet
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.5
|
|
4
4
|
Summary: Devialet API
|
|
5
5
|
Home-page: https://github.com/fwestenberg/devialet
|
|
6
6
|
Download-URL: https://github.com/fwestenberg/devialet/releases/latest
|
|
7
7
|
Author: fwestenberg
|
|
8
8
|
Author-email:
|
|
9
9
|
License: MIT
|
|
10
|
-
Keywords:
|
|
10
|
+
Keywords: Devialet,Home-Assistant
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: Topic :: Software Development :: Build Tools
|
|
@@ -3,7 +3,7 @@ from distutils.core import setup
|
|
|
3
3
|
setup(
|
|
4
4
|
name='devialet',
|
|
5
5
|
packages=['devialet'],
|
|
6
|
-
version='1.4.
|
|
6
|
+
version='1.4.5',
|
|
7
7
|
license='MIT',
|
|
8
8
|
description='Devialet API',
|
|
9
9
|
long_description_content_type="text/markdown",
|
|
@@ -12,7 +12,7 @@ setup(
|
|
|
12
12
|
author_email='',
|
|
13
13
|
url='https://github.com/fwestenberg/devialet',
|
|
14
14
|
download_url='https://github.com/fwestenberg/devialet/releases/latest',
|
|
15
|
-
keywords=['
|
|
15
|
+
keywords=['Devialet', 'Home-Assistant'],
|
|
16
16
|
install_requires=[
|
|
17
17
|
'aiohttp'
|
|
18
18
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|