pyvesync 2.1.16__tar.gz → 2.1.18__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.2
2
2
  Name: pyvesync
3
- Version: 2.1.16
3
+ Version: 2.1.18
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
@@ -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.16',
13
+ version='2.1.18',
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.',
@@ -66,7 +66,7 @@ humid_features: dict = {
66
66
  },
67
67
  'OASISMIST1000S': {
68
68
  'module': 'VeSyncHumid1000S',
69
- 'models': ['LUH-M101S-WUS'],
69
+ 'models': ['LUH-M101S-WUS', 'LUH-M101S-WEUR'],
70
70
  'features': [],
71
71
  'mist_modes': ['auto', 'sleep', 'manual'],
72
72
  'mist_levels': list(range(1, 10))
@@ -118,7 +118,7 @@ air_features: dict = {
118
118
  },
119
119
  'LV-PUR131S': {
120
120
  'module': 'VeSyncAir131',
121
- 'models': ['LV-PUR131S', 'LV-RH131S'],
121
+ 'models': ['LV-PUR131S', 'LV-RH131S', 'LV-RH131S-WM'],
122
122
  'modes': ['manual', 'auto', 'sleep', 'off'],
123
123
  'features': ['air_quality'],
124
124
  'levels': list(range(1, 3))
@@ -366,7 +366,6 @@ class VeSyncAirBypass(VeSyncBaseDevice):
366
366
  self.details['display'] = dev_dict.get('display', False)
367
367
  self.details['child_lock'] = dev_dict.get('child_lock', False)
368
368
  self.details['night_light'] = dev_dict.get('night_light', 'off')
369
- self.details['display'] = dev_dict.get('display', False)
370
369
  self.details['display_forever'] = dev_dict.get('display_forever',
371
370
  False)
372
371
  if self.air_quality_feature is True:
@@ -1135,6 +1134,15 @@ class VeSyncAirBaseV2(VeSyncAirBypass):
1135
1134
  """Return true if light is detected."""
1136
1135
  return self.details['environment_light_state']
1137
1136
 
1137
+ @property
1138
+ def fan_level(self):
1139
+ """Get current fan level."""
1140
+ try:
1141
+ speed = int(self.set_speed_level)
1142
+ except ValueError:
1143
+ speed = self.set_speed_level
1144
+ return speed
1145
+
1138
1146
  def get_details(self) -> None:
1139
1147
  """Build API V2 Purifier details dictionary."""
1140
1148
  head, body = self.build_api_dict('getPurifierStatus')
@@ -1573,7 +1581,19 @@ class VeSyncAir131(VeSyncBaseDevice):
1573
1581
  def __init__(self, details, manager):
1574
1582
  """Initilize air purifier class."""
1575
1583
  super().__init__(details, manager)
1576
-
1584
+ self.enabled = True
1585
+ self._config_dict = model_features(self.device_type)
1586
+ self._features = self._config_dict.get('features', [])
1587
+ if not isinstance(self._config_dict.get('modes'), list):
1588
+ logger.error(
1589
+ 'Please set modes for %s in the configuration',
1590
+ self.device_type)
1591
+ raise KeyError(f'Modes not set in configuration for {self.device_name}')
1592
+ self.modes = self._config_dict['modes']
1593
+ if 'air_quality' in self._features:
1594
+ self.air_quality_feature = True
1595
+ else:
1596
+ self.air_quality_feature = False
1577
1597
  self.details = {}
1578
1598
 
1579
1599
  def get_details(self) -> None:
@@ -1643,6 +1663,14 @@ class VeSyncAir131(VeSyncBaseDevice):
1643
1663
  """Get Air Quality."""
1644
1664
  return self.details.get('air_quality', 'unknown')
1645
1665
 
1666
+ @property
1667
+ def display_state(self) -> bool:
1668
+ """Get display state.
1669
+
1670
+ See [pyvesync.VeSyncAir131.get_details]
1671
+ """
1672
+ return self.details.get('screen_status', 'unknown') == "on"
1673
+
1646
1674
  @property
1647
1675
  def screen_status(self) -> str:
1648
1676
  """Return Screen status (on/off)."""
@@ -1989,6 +2017,7 @@ class VeSyncHumid200300S(VeSyncBaseDevice):
1989
2017
  """Build humidifier status dictionary."""
1990
2018
  self.enabled = dev_dict.get('enabled')
1991
2019
  self.device_status = 'on' if self.enabled else 'off'
2020
+ self.mode = dev_dict.get('mode', None)
1992
2021
  self.details['humidity'] = dev_dict.get('humidity', 0)
1993
2022
  self.details['mist_virtual_level'] = dev_dict.get(
1994
2023
  'mist_virtual_level', 0)
@@ -2178,6 +2207,11 @@ class VeSyncHumid200300S(VeSyncBaseDevice):
2178
2207
  """Turn 200S/300S Humidifier off."""
2179
2208
  return self.set_display(False)
2180
2209
 
2210
+ @property
2211
+ def display_state(self) -> bool:
2212
+ """Get display state."""
2213
+ return bool(self.details['display'])
2214
+
2181
2215
  def set_humidity(self, humidity: int) -> bool:
2182
2216
  """Set target 200S/300S Humidifier humidity."""
2183
2217
  if humidity < 30 or humidity > 80:
@@ -2231,7 +2265,7 @@ class VeSyncHumid200300S(VeSyncBaseDevice):
2231
2265
 
2232
2266
  if r is not None and Helpers.code_check(r):
2233
2267
  return True
2234
- logger.debug('Error setting humidity')
2268
+ logger.debug('Error setting night light brightness')
2235
2269
  return False
2236
2270
 
2237
2271
  def set_humidity_mode(self, mode: str) -> bool:
@@ -2692,6 +2726,12 @@ class VeSyncSuperior6000S(VeSyncBaseDevice):
2692
2726
  """Turn display off."""
2693
2727
  return self.set_display_enabled(False)
2694
2728
 
2729
+ @property
2730
+ def display_state(self) -> bool:
2731
+ """Get display state."""
2732
+ # This matches the values 0/1 set in set_display_enabled
2733
+ return self.details.get('display') == 1
2734
+
2695
2735
  def set_humidity(self, humidity: int) -> bool:
2696
2736
  """Set target humidity for humidity mode."""
2697
2737
  if humidity < 30 or humidity > 80:
@@ -2798,6 +2838,12 @@ class VeSyncSuperior6000S(VeSyncBaseDevice):
2798
2838
  """Get Humidity level."""
2799
2839
  return self.details['humidity']
2800
2840
 
2841
+ # Duplicate for compatibility
2842
+ @property
2843
+ def humidity(self):
2844
+ """Get Humidity level."""
2845
+ return self.details['humidity']
2846
+
2801
2847
  @property
2802
2848
  def mist_level(self):
2803
2849
  """Get current mist level."""
@@ -2859,7 +2905,7 @@ class VeSyncSuperior6000S(VeSyncBaseDevice):
2859
2905
  @property
2860
2906
  def auto_humidity(self):
2861
2907
  """Auto target humidity."""
2862
- return self.config['target_humidity']
2908
+ return self.details['target_humidity']
2863
2909
 
2864
2910
  @property
2865
2911
  def target_humidity(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyvesync
3
- Version: 2.1.16
3
+ Version: 2.1.18
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
File without changes
File without changes
File without changes
File without changes
File without changes