pyvesync 2.1.13__tar.gz → 2.1.14__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.1
2
2
  Name: pyvesync
3
- Version: 2.1.13
3
+ Version: 2.1.14
4
4
  Summary: pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers and Levoit Air Purifiers run on the VeSync app.
5
5
  Home-page: https://github.com/webdjoe/pyvesync
6
6
  Author: Mark Perdue, Joe Trabulsy
@@ -11,7 +11,10 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: End Users/Desktop
13
13
  Classifier: Natural Language :: English
14
- Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Topic :: Home Automation
15
18
  Requires-Python: >=3.9
16
19
  Description-Content-Type: text/markdown
17
20
  License-File: LICENSE
@@ -19,7 +22,7 @@ Requires-Dist: requests>=2.20.0
19
22
  Provides-Extra: dev
20
23
  Requires-Dist: pytest; extra == "dev"
21
24
  Requires-Dist: pytest-cov; extra == "dev"
22
- Requires-Dist: yaml; extra == "dev"
25
+ Requires-Dist: pyyaml; extra == "dev"
23
26
  Requires-Dist: tox; extra == "dev"
24
27
 
25
28
  # pyvesync [![build status](https://img.shields.io/pypi/v/pyvesync.svg)](https://pypi.python.org/pypi/pyvesync) [![Build Status](https://dev.azure.com/webdjoe/pyvesync/_apis/build/status/webdjoe.pyvesync?branchName=master)](https://dev.azure.com/webdjoe/pyvesync/_build/latest?definitionId=4&branchName=master) [![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/) [![PyPI license](https://img.shields.io/pypi/l/ansicolortags.svg)](https://pypi.python.org/pypi/ansicolortags/) <!-- omit in toc -->
@@ -10,7 +10,7 @@ with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
10
10
 
11
11
  setup(
12
12
  name='pyvesync',
13
- version='2.1.13',
13
+ version='2.1.14',
14
14
  description='pyvesync is a library to manage Etekcity\
15
15
  Devices, Cosori Air Fryers and Levoit Air \
16
16
  Purifiers run on the VeSync app.',
@@ -25,14 +25,17 @@ setup(
25
25
  'Intended Audience :: Developers',
26
26
  'Intended Audience :: End Users/Desktop',
27
27
  'Natural Language :: English',
28
- 'Programming Language :: Python :: 3.8',
28
+ 'Programming Language :: Python :: 3.9',
29
+ 'Programming Language :: Python :: 3.10',
30
+ 'Programming Language :: Python :: 3.11',
31
+ 'Topic :: Home Automation',
29
32
  ],
30
33
  keywords=['iot', 'vesync', 'levoit', 'etekcity', 'cosori', 'valceno'],
31
34
  packages=find_packages('src', exclude=['tests', 'test*']),
32
35
  package_dir={'': 'src'},
33
36
  install_requires=['requests>=2.20.0'],
34
37
  extras_require={
35
- 'dev': ['pytest', 'pytest-cov', 'yaml', 'tox']
38
+ 'dev': ['pytest', 'pytest-cov', 'pyyaml', 'tox']
36
39
  },
37
40
  python_requires='>=3.9',
38
41
  )
@@ -273,18 +273,20 @@ class Helpers:
273
273
  if cls.shouldredact:
274
274
  stringvalue = re.sub(
275
275
  (
276
- r'(?i)'
277
- r'((?<=token": ")|'
278
- r'(?<=password": ")|'
279
- r'(?<=email": ")|'
280
- r'(?<=tk": ")|'
281
- r'(?<=accountId": ")|'
282
- r'(?<=authKey": ")|'
283
- r'(?<=uuid": ")|'
284
- r'(?<=cid": "))'
285
- r'[^"]+'
276
+ r"(?i)"
277
+ r'((?<=token":\s")|'
278
+ r'(?<=password":\s")|'
279
+ r'(?<=email":\s")|'
280
+ r'(?<=tk":\s")|'
281
+ r'(?<=accountId":\s")|'
282
+ r'(?<=authKey":\s")|'
283
+ r'(?<=uuid":\s")|'
284
+ r'(?<=cid":\s")|'
285
+ r"(?<=token\s)|"
286
+ r"(?<=account_id\s))"
287
+ r'[^"\s]+'
286
288
  ),
287
- '##_REDACTED_##',
289
+ "##_REDACTED_##",
288
290
  stringvalue,
289
291
  )
290
292
  return stringvalue
@@ -16,7 +16,7 @@ Attributes:
16
16
  Note:
17
17
  The bulb module is built from the `feature_dict` dictionary and used by the
18
18
  `vesync.object_factory` and tests to determine the class to instantiate for
19
- each bulb model.
19
+ each bulb model. These classes should not be instantiated manually.
20
20
 
21
21
  Examples:
22
22
  The following example shows the structure of the `feature_dict` dictionary:
@@ -48,6 +48,8 @@ logger = logging.getLogger(__name__)
48
48
 
49
49
  NUMERIC_T = Optional[Union[int, float, str]]
50
50
 
51
+ # --8<-- [start:feature_dict]
52
+
51
53
  feature_dict: dict = {
52
54
  'ESL100':
53
55
  {
@@ -75,10 +77,11 @@ feature_dict: dict = {
75
77
  }
76
78
  }
77
79
 
80
+ # --8<-- [end:feature_dict]
78
81
 
79
82
  bulb_modules: dict = {k: v['module'] for k, v in feature_dict.items()}
80
83
 
81
- __all__: list = list(bulb_modules.values()) + ['bulb_modules']
84
+ __all__: list = list(bulb_modules.values()) + ["bulb_modules", "VeSyncBulb"]
82
85
 
83
86
 
84
87
  def pct_to_kelvin(pct: float, max_k: int = 6500, min_k: int = 2700) -> float:
@@ -91,7 +94,8 @@ class VeSyncBulb(VeSyncBaseDevice):
91
94
 
92
95
  Abstract base class to provide methods for controlling and
93
96
  getting details of VeSync bulbs. Inherits from
94
- [`VeSyncBaseDevice`][pyvesync.vesyncbasedevice.VeSyncBaseDevice].
97
+ [`VeSyncBaseDevice`][pyvesync.vesyncbasedevice.VeSyncBaseDevice]. This class
98
+ should not be used directly for devices, but rather subclassed for each.
95
99
 
96
100
  Attributes:
97
101
  brightness (int): Brightness of bulb (0-100).
@@ -539,7 +543,26 @@ class VeSyncBulb(VeSyncBaseDevice):
539
543
  print(f'{line[0]:.<30} {line[1]} {line[2]}')
540
544
 
541
545
  def displayJSON(self) -> str:
542
- """Return bulb device info in JSON format."""
546
+ """Return bulb device info in JSON format.
547
+
548
+ Returns:
549
+ str: JSON formatted string of bulb details.
550
+
551
+ Example:
552
+ ```json
553
+ {
554
+ "deviceName": "Bulb",
555
+ "deviceStatus": "on",
556
+ "connectionStatus": "online",
557
+ "Brightness": "100%",
558
+ "WhiteTemperaturePct": "100%",
559
+ "WhiteTemperatureKelvin": "6500K",
560
+ "ColorHSV": "{"hue": 0, "saturation": 0, "value": 0}",
561
+ "ColorRGB": "{"red": 0, "green": 0, "blue": 0}",
562
+ "ColorMode": "hsv"
563
+ }
564
+ ```
565
+ """
543
566
  sup = super().displayJSON()
544
567
  sup_val = json.loads(sup)
545
568
  if self.connection_status == 'online':
@@ -595,17 +618,16 @@ class VeSyncBulbESL100MC(VeSyncBulb):
595
618
  two named tuple attributes - `hsv` & `rgb`. See [pyvesync.helpers.Color][].
596
619
 
597
620
  Notes:
598
- The `self.details` dictionary is structured as follows:
621
+ The details dictionary contains the device information retreived by the
622
+ `update()` method:
599
623
  ```python
600
- >>> self.details
601
- {
602
- 'brightness': 0,
603
- 'colorMode': 'color',
604
- 'red': 0,
605
- 'green': 0,
606
- 'blue': 0
624
+ details = {
625
+ 'brightness': 50,
626
+ 'colorMode': 'rgb',
627
+ 'color' : Color(red=0, green=0, blue=0)
607
628
  }
608
629
  ```
630
+ See pyvesync.helpers.Color for more information on the Color dataclass.
609
631
  """
610
632
 
611
633
  def __init__(self, details: dict[str, str | list], manager: VeSync) -> None:
@@ -613,7 +635,7 @@ class VeSyncBulbESL100MC(VeSyncBulb):
613
635
 
614
636
  Args:
615
637
  details (dict): Dictionary of bulb state details.
616
- manager (VeSync): Manager class used to make API calls
638
+ manager (VeSync): Manager class used to make API calls.
617
639
  """
618
640
  super().__init__(details, manager)
619
641
  self.details: dict = {}
@@ -811,7 +833,8 @@ class VeSyncBulbESL100MC(VeSyncBulb):
811
833
  class VeSyncBulbESL100(VeSyncBulb):
812
834
  """Object to hold VeSync ESL100 light bulb.
813
835
 
814
- This bulb only has the dimmable feature.
836
+ This bulb only has the dimmable feature. Inherits from pyvesync.vesyncbulb.VeSyncBulb
837
+ and pyvesync.vesyncbasedevice.VeSyncBaseDevice.
815
838
 
816
839
  Attributes:
817
840
  details (dict): Dictionary of bulb state details.
@@ -10,7 +10,7 @@ from pyvesync.helpers import Helpers, Timer
10
10
  humid_features: dict = {
11
11
  'Classic300S': {
12
12
  'module': 'VeSyncHumid200300S',
13
- 'models': ['Classic300S', 'LUH-A601S-WUSB'],
13
+ 'models': ['Classic300S', 'LUH-A601S-WUSB', 'LUH-A601S-AUSW'],
14
14
  'features': ['nightlight'],
15
15
  'mist_modes': ['auto', 'sleep', 'manual'],
16
16
  'mist_levels': list(range(1, 10))
@@ -60,7 +60,7 @@ humid_features: dict = {
60
60
  'LUH-O601S-WUS',
61
61
  'LUH-O601S-KUS'],
62
62
  'features': ['warm_mist'],
63
- 'mist_modes': ['humidity', 'sleep', 'manual'],
63
+ 'mist_modes': ['auto', 'humidity', 'sleep', 'manual'],
64
64
  'mist_levels': list(range(1, 10)),
65
65
  'warm_mist_levels': list(range(4))
66
66
  },
@@ -73,7 +73,7 @@ humid_features: dict = {
73
73
  },
74
74
  'Superior6000S': {
75
75
  'module': 'VeSyncSuperior6000S',
76
- 'models': ['LEH-S601S-WUS'],
76
+ 'models': ['LEH-S601S-WUS', 'LEH-S601S-WUSR'],
77
77
  'features': [],
78
78
  'mist_modes': ['auto', 'humidity', 'sleep', 'manual'],
79
79
  'mist_levels': list(range(1, 10))
@@ -1,4 +1,24 @@
1
- """Classes for VeSync Switch Devices."""
1
+ """Classes for VeSync Switch Devices.
2
+
3
+ This module provides classes for VeSync Switch Devices:
4
+
5
+ 1. VeSyncSwitch: Abstract Base class for VeSync Switch Devices.
6
+ 2. VeSyncWallSwitch: Class for VeSync Wall Switch Devices ESWL01 and ESWL03.
7
+ 3. VeSyncDimmerSwitch: Class for VeSync Dimmer Switch Devices ESWD16.
8
+
9
+
10
+ Attributes:
11
+ feature_dict (dict): Dictionary of switch models and their supported features.
12
+ Defines the class to use for each switch model and the list of features
13
+ switch_modules (dict): Dictionary of switch models as keys and their associated
14
+ classes as string values.
15
+
16
+ Note:
17
+ The switch device is built from the `feature_dict` dictionary and used by the
18
+ `vesync.object_factory` during initial call to pyvesync.vesync.update() and
19
+ determines the class to instantiate for each switch model. These classes should
20
+ not be instantiated manually.
21
+ """
2
22
 
3
23
  import logging
4
24
  import json
@@ -10,6 +30,8 @@ from pyvesync.vesyncbasedevice import VeSyncBaseDevice
10
30
 
11
31
  logger = logging.getLogger(__name__)
12
32
 
33
+ # --8<-- [start:feature_dict]
34
+
13
35
  feature_dict: Dict[str, Dict[str, Union[list, str]]] = {
14
36
  'ESWL01': {
15
37
  'module': 'VeSyncWallSwitch',
@@ -25,6 +47,8 @@ feature_dict: Dict[str, Dict[str, Union[list, str]]] = {
25
47
  }
26
48
  }
27
49
 
50
+ # --8<-- [end:feature_dict]
51
+
28
52
  switch_modules: dict = {k: v['module']
29
53
  for k, v in feature_dict.items()}
30
54
 
@@ -32,7 +56,16 @@ __all__: list = list(switch_modules.values()) + ['switch_modules']
32
56
 
33
57
 
34
58
  class VeSyncSwitch(VeSyncBaseDevice):
35
- """Etekcity Switch Base Class."""
59
+ """Etekcity Switch Base Class.
60
+
61
+ Abstract Base Class for Etekcity Switch Devices, inherting from
62
+ pyvesync.vesyncbasedevice.VeSyncBaseDevice. Should not be instantiated directly,
63
+ subclassed by VeSyncWallSwitch and VeSyncDimmerSwitch.
64
+
65
+ Attributes:
66
+ features (list): List of features supported by the switch device.
67
+ details (dict): Dictionary of switch device details.
68
+ """
36
69
 
37
70
  __metaclasss__ = ABCMeta
38
71
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyvesync
3
- Version: 2.1.13
3
+ Version: 2.1.14
4
4
  Summary: pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers and Levoit Air Purifiers run on the VeSync app.
5
5
  Home-page: https://github.com/webdjoe/pyvesync
6
6
  Author: Mark Perdue, Joe Trabulsy
@@ -11,7 +11,10 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: End Users/Desktop
13
13
  Classifier: Natural Language :: English
14
- Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Topic :: Home Automation
15
18
  Requires-Python: >=3.9
16
19
  Description-Content-Type: text/markdown
17
20
  License-File: LICENSE
@@ -19,7 +22,7 @@ Requires-Dist: requests>=2.20.0
19
22
  Provides-Extra: dev
20
23
  Requires-Dist: pytest; extra == "dev"
21
24
  Requires-Dist: pytest-cov; extra == "dev"
22
- Requires-Dist: yaml; extra == "dev"
25
+ Requires-Dist: pyyaml; extra == "dev"
23
26
  Requires-Dist: tox; extra == "dev"
24
27
 
25
28
  # pyvesync [![build status](https://img.shields.io/pypi/v/pyvesync.svg)](https://pypi.python.org/pypi/pyvesync) [![Build Status](https://dev.azure.com/webdjoe/pyvesync/_apis/build/status/webdjoe.pyvesync?branchName=master)](https://dev.azure.com/webdjoe/pyvesync/_build/latest?definitionId=4&branchName=master) [![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/) [![PyPI license](https://img.shields.io/pypi/l/ansicolortags.svg)](https://pypi.python.org/pypi/ansicolortags/) <!-- omit in toc -->
@@ -3,5 +3,5 @@ requests>=2.20.0
3
3
  [dev]
4
4
  pytest
5
5
  pytest-cov
6
- yaml
6
+ pyyaml
7
7
  tox
File without changes
File without changes
File without changes
File without changes
File without changes