You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Cool to Soft White Tunable Dimmable Bulb (ESL100CW)
99
99
100
100
### Valceno Bulbs
101
+
101
102
1. Multicolor Bulb (XYD0001)
102
103
103
104
### Levoit Humidifiers
105
+
104
106
1. Dual 200S
105
107
2. Classic 300S
106
108
3. LUH-D301S-WEU Dual (200S)
107
109
4. LV600S
108
110
5. OasisMist LUS-O415S-WUS
109
111
110
112
Cosori Air Fryer
113
+
111
114
1. Cosori 3.7 and 5.8 Quart Air Fryer
112
115
113
116
## Usage
@@ -139,6 +142,7 @@ my_bulb.set_brightness(75)
139
142
# get its details in JSON and print
140
143
print(my_bulb.displayJSON())
141
144
```
145
+
142
146
Devices are stored in the respective lists in the instantiated `VeSync` class:
143
147
144
148
```python
@@ -163,14 +167,17 @@ for switch in manager.switches:
163
167
if switch.device_name == switch_name:
164
168
switch.turn_on()
165
169
```
170
+
166
171
## Configuration
167
172
168
173
### Time Zones
174
+
169
175
The `time_zone` argument is optional but the specified time zone must match time zone in the tz database (IANNA Time Zone Database), see this link for reference:
The time zone determines how the energy history is generated for the smart outlets, i.e. for the week starts at 12:01AM Sunday morning at the specified time zone. If no time zone or an invalid time zone is entered the default is America/New_York
172
178
173
179
### Outlet energy data update interval
180
+
174
181
If outlets are going to be continuously polled, a custom energy update interval can be set - The default is 6 hours (21600 seconds)
175
182
176
183
```python
@@ -182,7 +189,9 @@ manager.energy_update_interval = 360 # time in seconds
182
189
### Get electricity metrics of outlets
183
190
184
191
Bypass the interval check to trigger outlet energy update.
192
+
185
193
```python
194
+
186
195
for s in manager.outlets:
187
196
s.update_energy(check_bypass=False) # Get energy history for each device
188
197
```
@@ -311,6 +320,7 @@ NOTE: LV-PUR131S outputs `air_quality` as a string, such as `Excellent`
311
320
`VeSyncFan.change_fan_speed(speed=None)` - Change fan speed. Call without speed to toggle to next speed
312
321
313
322
Compatible levels for each model:
323
+
314
324
- Core 200S [1, 2, 3]
315
325
- Core 300S/400S [1, 2, 3, 4]
316
326
- PUR131S [1, 2, 3]
@@ -333,6 +343,11 @@ Compatible levels for each model:
333
343
334
344
`VeSyncFan.set_night_light('on'|'dim'|'off')` - Set night light brightness
335
345
346
+
`VeSyncFan.get_timer()` - Get any running timers, stores Timer DataClass in `VeSyncFan.timer`
347
+
348
+
`VeSyncFan.set_timer(timer_duration=3000)` - Set a timer for the device, only turns device off. Timer DataClass stored in `VeSyncFan.timer`
349
+
350
+
`VeSyncFan.clear_timer()` - Cancel any running timer
336
351
337
352
### Lights API Methods & Properties
338
353
@@ -356,9 +371,9 @@ Compatible levels for each model:
356
371
357
372
*Compatible with ESL100MC & Valceno Bulbs*
358
373
**Properties**
359
-
`VeSyncBulb.color` - Returns a dataclass with HSV and RGB attributes that are named tuples
374
+
`VeSyncBulb.color` - Returns a Dataclass with HSV and RGB attributes that are named tuples
@@ -549,6 +564,7 @@ They can be set through the `VeSyncAirFryer158.fryer_status` dataclass but shoul
549
564
`VeSyncAirFryer158.preheat_last_time` - The last minutes remaining returned from API for preheat mode
550
565
551
566
`VeSyncAirFryer158.cook_status` - Status of air fryer. This can be the following states:
567
+
552
568
1.`standby` - Air fryer is off and no cook or preheat is in progress
553
569
2.`cooking` - Air fryer is actively cooking
554
570
3.`cookStop` - Cooking is paused and can be resumed
@@ -565,7 +581,7 @@ They can be set through the `VeSyncAirFryer158.fryer_status` dataclass but shoul
565
581
566
582
`VeSyncAirFryer158.remaining_time` - Returns minutes remaining based on timestamp of last API return when air fryer is running. Returns `None` if not running
567
583
568
-
`VeSyncAirFryer158.fryer_status` - Dataclass that contains the status of the air fryer. The attributes of this dataclass are directly accessible from the `VeSyncAirFryer158` properties and **should not be directly set.**
584
+
`VeSyncAirFryer158.fryer_status` - Dataclass that contains the status of the air fryer. The attributes of this Dataclass are directly accessible from the `VeSyncAirFryer158` properties and **should not be directly set.**
569
585
570
586
##### Air Fryer Methods
571
587
@@ -583,6 +599,43 @@ They can be set through the `VeSyncAirFryer158.fryer_status` dataclass but shoul
583
599
584
600
`VeSyncAirFryer158.end()` - End cooking or preheating and return air fryer to `standby` state
585
601
602
+
603
+
### Timer DataClass
604
+
605
+
This is the a Timer DataClass that is used in the `get_timer()` or `set_timer()` methods *only implemented for Levoit Core 200S and 300S Air Purifier*, will eventually integrate with remaining devices. This object is created when the device timer methods are called. **The `pause()`, `resume()` and `stop()` methods for this DataClass only impact the timer locally and do not update the API.**
606
+
607
+
```python
608
+
from pyvesync.helpers import Timer
609
+
610
+
timer = Timer(timer_duration=60, id=1)
611
+
612
+
# Get time remaining in seconds
613
+
# Calculates based on timer elapsed each time property is called
614
+
timer.remaining_time
615
+
616
+
# Get status
617
+
timer.status
618
+
619
+
# Get action
620
+
timer.action
621
+
622
+
# Set status - active or done
623
+
timer.status ='active'
624
+
625
+
# set time remaining in seconds, does not edit status
626
+
timer.remaining_time =120
627
+
628
+
# Pause timer - Does not update API - only pauses locally
629
+
timer.pause()
630
+
631
+
# End timer -Does not update API - only ends locally
632
+
timer.end()
633
+
634
+
# Resume timer - Does not update API - only Resumes locally
635
+
timer.start()
636
+
```
637
+
638
+
586
639
### JSON Output API
587
640
588
641
The `device.displayJSON()` method outputs properties and status of the device
@@ -682,9 +735,9 @@ This output only applies to dimmable switch. The standard switch has the defaul
682
735
"Filter Life": "99"# remaining filter life in percent
683
736
}
684
737
```
685
-
#### JSON Output for 300S Humidifier
686
738
687
739
```python
740
+
688
741
{
689
742
"Mode": "manual", # auto, manual, sleep
690
743
"Humidity": 20, # percent
@@ -703,21 +756,21 @@ This output only applies to dimmable switch. The standard switch has the defaul
703
756
704
757
```python
705
758
{
706
-
"Device Name": "MyPurifier",
707
-
"Model": "Core200S",
708
-
"Subdevice No": "None",
709
-
"Status": "on",
710
-
"Online": "online",
711
-
"Type": "wifi-air",
712
-
"CID": "asd_sdfKIHG7IJHGwJGJ7GJ_ag5h3G55",
713
-
"Mode": "manual",
714
-
"Filter Life": "99",
715
-
"Fan Level": "1",
716
-
"Display": true,
717
-
"Child Lock": false,
718
-
"Night Light": "off",
719
-
"Display Config": true,
720
-
"Display_Forever Config": false
759
+
"Device Name": "MyPurifier",
760
+
"Model": "Core200S",
761
+
"Subdevice No": "None",
762
+
"Status": "on",
763
+
"Online": "online",
764
+
"Type": "wifi-air",
765
+
"CID": "asd_sdfKIHG7IJHGwJGJ7GJ_ag5h3G55",
766
+
"Mode": "manual",
767
+
"Filter Life": "99",
768
+
"Fan Level": "1",
769
+
"Display": true,
770
+
"Child Lock": false,
771
+
"Night Light": "off",
772
+
"Display Config": true,
773
+
"Display_Forever Config": false
721
774
}
722
775
```
723
776
@@ -744,6 +797,7 @@ This output only applies to dimmable switch. The standard switch has the defaul
744
797
"Display_Forever Config": false
745
798
}
746
799
```
800
+
747
801
#### JSON Output for 600S Purifier
748
802
749
803
```python
@@ -813,7 +867,7 @@ manager.update()
813
867
814
868
~~If you would like new devices to be added, you will need to capture the packets from the app. The easiest way to do this is by using [Packet Capture for Android](https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture&hl=en_US&gl=US). This works without rooting the device. If you do not have an android or are concerned with adding an app that uses a custom certificate to read the traffic, you can use an Android emulator such as [Nox](https://www.bignox.com/).~~
815
869
816
-
SSL pinning makes capturing packets with Android ~~not feasible anymore~~ harder than before. A system-wide proxy (https://play.google.com/store/apps/details?id=org.proxydroid&hl=en) can be used if ssl pinning is disabled (https://github.com/ViRb3/TrustMeAlready).
870
+
SSL pinning makes capturing packets with Android ~~not feasible anymore~~ harder than before. A system-wide proxy [ProxyDroid](https://play.google.com/store/apps/details?id=org.proxydroid&hl=en) can be used if ssl pinning is disabled [TrustMeAlready](https://github.com/ViRb3/TrustMeAlready).
817
871
818
872
Charles Proxy is a proxy that allows you to perform MITM SSL captures on an iOS device. This is the only way to capture packets that I am aware of that is currently possible.
819
873
@@ -824,19 +878,22 @@ After you capture the packets, please redact the `accountid` and `token`. If you
0 commit comments