aioamazondevices 1.9.0__tar.gz → 1.10.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aioamazondevices
3
- Version: 1.9.0
3
+ Version: 1.10.0
4
4
  Summary: Python library to control Amazon devices
5
5
  License: Apache-2.0
6
6
  Author: Simone Chemelli
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "aioamazondevices"
3
- version = "1.9.0"
3
+ version = "1.10.0"
4
4
  description = "Python library to control Amazon devices"
5
5
  authors = ["Simone Chemelli <simone.chemelli@gmail.com>"]
6
6
  license = "Apache-2.0"
@@ -1,6 +1,6 @@
1
1
  """aioamazondevices library."""
2
2
 
3
- __version__ = "1.9.0"
3
+ __version__ = "1.10.0"
4
4
 
5
5
 
6
6
  from .api import AmazonDevice, AmazonEchoApi
@@ -552,7 +552,7 @@ class AmazonEchoApi:
552
552
 
553
553
  if not self._csrf_cookie:
554
554
  self._csrf_cookie = raw_resp.cookies.get(CSRF_COOKIE, Morsel()).value
555
- _LOGGER.error("CSRF cookie value: <%s>", self._csrf_cookie)
555
+ _LOGGER.debug("CSRF cookie value: <%s>", self._csrf_cookie)
556
556
 
557
557
  json_data = {} if len(response_data) == 0 else await raw_resp.json()
558
558
 
@@ -795,3 +795,15 @@ class AmazonEchoApi:
795
795
  return await self._send_message(
796
796
  device, AmazonSequenceType.TextCommand, message_body
797
797
  )
798
+
799
+ async def set_do_not_disturb(self, device: AmazonDevice, state: bool) -> None:
800
+ """Set do_not_disturb flag."""
801
+ payload = {
802
+ "deviceSerialNumber": device.serial_number,
803
+ "deviceType": device.device_type,
804
+ "enabled": state,
805
+ }
806
+ url = f"https://alexa.amazon.{self._domain}/api/dnd/status"
807
+ await self._session_request(
808
+ method="PUT", url=url, input_data=payload, json_data=True
809
+ )