Skip to content

Commit 65fa8d0

Browse files
authored
Merge pull request #135 from bdwyer2/patch-1
Add support for 400s PM 2.5 readings
2 parents 12736dd + f8cf9b1 commit 65fa8d0

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ VeSyncFan.details = {
262262

263263
```
264264

265+
NOTE: LV-PUR131S outputs `air_quality` as a string, such as `Excellent`
266+
265267
`VeSyncFan.features` - Unique features to air purifier model. Currently, the only feature is air_quality, which is not supported on Core 200S.
266268

267269
`VeSyncFan.modes` - Modes of operation supported by model - [sleep, off, auto]
@@ -270,7 +272,9 @@ VeSyncFan.details = {
270272

271273
`VeSyncFan.filter_life` - Return the percentage of filter life remaining
272274

273-
`VeSyncFan.air_quality` - Return air quality reading - Not available on Core 200S
275+
`VeSyncFan.air_quality` - Return air quality level as integer, 1 being the best - Not available on Core 200S
276+
277+
`VeSyncFan.air_quality_value` - PM2.5 air quality reading
274278

275279
`VeSyncFan.screen_status` - Get Status of screen on/off
276280

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='pyvesync',
13-
version='2.0.2',
13+
version='2.0.3',
1414
description='pyvesync is a library to manage Etekcity\
1515
Devices and Levoit Air Purifier',
1616
long_description=long_description,

src/pyvesync/vesyncfan.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def __init__(self, details: Dict[str, list], manager):
146146
'night_light': 'off',
147147
}
148148
if self.air_quality_feature is True:
149-
self.details['ait_quality'] = 0
149+
self.details['air_quality'] = 0
150150
self.config: Dict[str, Union[str, int, float, bool]] = {
151151
'display': False,
152152
'display_forever': False
@@ -193,6 +193,8 @@ def build_purifier_dict(self, dev_dict: dict) -> None:
193193
self.details['display_forever'] = dev_dict.get('display_forever',
194194
False)
195195
if self.air_quality_feature:
196+
self.details['air_quality_value'] = dev_dict.get(
197+
'air_quality_value', 0)
196198
self.details['air_quality'] = dev_dict.get('air_quality', 0)
197199

198200
def build_config_dict(self, conf_dict: Dict[str, str]) -> None:
@@ -800,7 +802,7 @@ def display(self) -> None:
800802
('Air Quality: ', self.air_quality, ''),
801803
('Mode: ', self.mode, ''),
802804
('Screen Status: ', self.screen_status, ''),
803-
('Filter Life: ', self.filter_life, ' percent'),
805+
('Filter Life: ', json.dumps(self.filter_life), ' percent'),
804806
]
805807
for line in disp1:
806808
print(f'{line[0]:.<15} {line[1]} {line[2]}')
@@ -816,7 +818,7 @@ def displayJSON(self) -> str:
816818
'Air Quality': self.air_quality,
817819
'Mode': self.mode,
818820
'Screen Status': self.screen_status,
819-
'Filter Life': str(self.filter_life),
821+
'Filter Life': str(self.filter_life)
820822
}
821823
)
822824
return sup_val

0 commit comments

Comments
 (0)