Package: tv4you2016-pyvesync
pyvesyncpyvesync is a library to manage VeSync compatiblesmart home devicesTable of ContentsInstallationSupported DevicesEtekcity OutletsWall SwitchesLevoit Air PurifiersEtekcity BulbsValceno BulbsLevoit HumidifiersUsageConfigurationTime ZonesOutlet energy data update intervalExample UsageGet electricity metrics of outletsAPI DetailsManager APIStandard Device APIStandard PropertiesStandard MethodsOutlet API Methods & PropertiesOutlet power and energy API Methods & PropertiesModel ESW15-USA 15A/1800W Methods (Have a night light)Standard Air Purifier Properties & MethodsAir Purifier PropertiesAir Purifier MethodsLevoit Purifier Core200S/300S/400S and Vital 100S/200S PropertiesLevoit Purifier Core200S/300S/400S and Vital 100S/200S MethodsLevoit Vital 100S/200S Properties and MethodsLights API Methods & PropertiesBrightness Light Bulb Method and PropertiesLight Bulb Color Temperature Methods and PropertiesMulticolor Light Bulb Methods and PropertiesDimmable Switch Methods and PropertiesLevoit Humidifier Methods and PropertiesHumidifier PropertiesHumidifer Methods600S warm mist featureCosori DevicesCosori 3.7 and 5.8 Quart Air FryerAir Fryer PropertiesAir Fryer MethodsTimer DataClassJSON Output APIJSON Output for All DevicesJSON Output for OutletsJSON Output for Dimmable SwitchJSON Output for Dimmable BulbJSON Output for Tunable BulbJSON Output for Multicolor BulbJSON Output for Air PurifierJSON Output for Core200S PurifierJSON Output for 400S PurifierJSON Output for 600S PurifierNotesDebug modeRedact modeFeature RequestsInstallationInstall the latest version from pip:pipinstallpyvesyncSupported DevicesEtekcity OutletsVoltson Smart WiFi Outlet- Round (7A model ESW01-USA)Voltson Smart WiFi Outlet - Round (10A model ESW01-EU)Voltson Smart Wifi Outlet - Round (10A model ESW03-USA)Voltson Smart WiFi Outlet - Rectangle (15A model ESW15-USA)Two Plug Outdoor Outlet (ESO15-TB) (Each plug is a separateVeSyncOutletobject, energy readings are for both plugs combined)Wall SwitchesEtekcity Smart WiFi Light Switch (model ESWL01)Etekcity Wifi Dimmer Switch (ESD16)Levoit Air PurifiersLV-PUR131SCore 200SCore 300SCore 400SCore 600SVital 100SVital 200SEtekcity BulbsSoft White Dimmable Smart Bulb (ESL100)Cool to Soft White Tunable Dimmable Bulb (ESL100CW)Valceno BulbsMulticolor Bulb (XYD0001)Levoit HumidifiersDual 200SClassic 300SLUH-D301S-WEU Dual (200S)LV600SOasisMist LUS-O415S-WUSOasisMist LUH-M101S-WUSCosori Air FryerCosori 3.7 and 5.8 Quart Air FryerUsageTo start with the module:frompyvesyncimportVeSyncmanager=VeSync("EMAIL","PASSWORD","TIME_ZONE",debug=False,redact=True)manager.login()# debug and redact are optional arguments, the above values are their defaults# Get/Update Devices from server - populate device listsmanager.update()my_switch=manager.outlets[0]# Turn on the first switchmy_switch.turn_on()# Turn off the first switchmy_switch.turn_off()# Get energy usage data for outletsmanager.update_energy()# Set bulb brightness to 75% of first bulb in the listmy_bulb=manager.bulbs[0]my_bulb.set_brightness(75)# get its details in JSON and printprint(my_bulb.displayJSON())Devices are stored in the respective lists in the instantiatedVeSyncclass:manager.login()manager.update()manager.outlets=[VeSyncOutletObjects]manager.switches=[VeSyncSwitchObjects]manager.fans=[VeSyncFanObjects]manager.bulbs=[VeSyncBulbObjects]# Get device (outlet, etc.) by device namedev_name="My Device"fordeviceinmanager.outlets:ifdevice.device_name==dev_name:my_device=devicedevice.display()# Turn on switch by switch nameswitch_name="My Switch"forswitchinmanager.switches:ifswitch.device_name==switch_name:switch.turn_on()ConfigurationTime ZonesThetime_zoneargument is optional but the specified time zone must match time zone in the tz database (IANNA Time Zone Database), see this link for reference:tz database.
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_YorkOutlet energy data update intervalIf outlets are going to be continuously polled, a custom energy update interval can be set - The default is 6 hours (21600 seconds)manager.energy_update_interval=360# time in secondsExample UsageGet electricity metrics of outletsBypass the interval check to trigger outlet energy update.forsinmanager.outlets:s.update_energy(check_bypass=False)# Get energy history for each deviceAPI DetailsManager APIVeSync.get_devices()- Returns a list of devicesVeSync.login()- Uses class username and password to login to VeSyncVeSync.update()- Fetch updated information about devicesVeSync.update_all_devices()- Fetch details for all devices (runVeSyncDevice.update())VeSync.update_energy(bypass_check=False)- Get energy history for all outlets - Builds week, month and year nested energy dictionary.  Setbypass_check=Trueto disable the library from checking the update intervalStandard Device APIThese properties and methods are available for all devices.Standard PropertiesVeSyncDevice.device_name- Name given when registering deviceVeSyncDevice.device_type- Model of device, used to determine proper device class.VeSyncDevice.connection_status- Device online/offlineVeSyncDevice.config_module- Special configuration identifier for device. Currently, not used in this API.VeSyncDevice.sub_device_no- Sub-device number for certain devices. Used for the outdoor outlet.VeSyncDevice.device_status- Device on/offVeSyncDevice.is_on- Returns boolean True/False if device is on.VeSyncDevice.firmware_update- Returns True is new firmware is availableStandard MethodsVeSyncDevice.turn_on()- Turn on the deviceVeSyncDevice.turn_off()- Turn off the deviceVeSyncDevice.update()- Fetch updated information about deviceVeSyncDevice.active_time- Return active time of the device in minutesVeSyncDevice.get_config()- Retrieve Configuration data such as firmware version for device and store in theVeSyncDevice.configdictionaryOutlet API Methods & PropertiesOutlet power and energy API Methods & PropertiesVeSyncOutlet.update_energy(bypass_check=False)- Get outlet energy history - Builds week, month and year nested energy dictionary. Setbypass_check=Trueto disable the library from checking the update intervalVeSyncOutlet.energy_today- Return current energy usage in kWhVeSyncOutlet.power- Return current power in watts of the deviceVeSyncOutlet.voltage- Return current voltage readingVesyncOutlet.weekly_energy_total- Return total energy reading for the past week in kWh, starts 12:01AM Sunday morningVesyncOutlet.monthly_energy_total- Return total energy reading for the past month in kWhVesyncOutlet.yearly_energy_total- Return total energy reading for the past year in kWhModel ESW15-USA 15A/1800W Methods (Have a night light)The rectangular smart switch model supports some additional functionality on top of the regular api callVeSyncOutlet.nightlight_status- Get the status of the nightlightVeSyncOutlet.nightlight_brightness- Get the brightness of the nightlightVeSyncOutlet.turn_on_nightlight()- Turn on the nightlightVeSyncOutlet.turn_off_nightlight()- Turn off the nightlightStandard Air Purifier Properties & MethodsAir Purifier PropertiesVeSyncFan.details- Dictionary of device detailsVeSyncFan.update()VeSyncFan.details={'active_time':30004,# minutes'filter_life':45,# percent of filter life remaining'screen_status':'on',# display on/off'level':3,# fan level'air_quality':2,# air quality level}NOTE: LV-PUR131S outputsair_qualityas a string, such asExcellentVeSyncFan.features- Unique features to air purifier model. Currently, the only feature is air_quality, which is not supported on Core 200S.VeSyncFan.modes- Modes of operation supported by model - [sleep, off, auto]VeSyncFan.fan_level- Return the level of the fanVeSyncFan.filter_life- Return the percentage of filter life remainingVeSyncFan.air_quality- Return air quality level as integer, 1 being the best - Not available on Core 200SVeSyncFan.air_quality_value- PM2.5 air quality readingVeSyncFan.screen_status- Get Status of screen on/offAir Purifier MethodsVeSyncFan.auto_mode()- Change mode to autoVeSyncFan.manual_mode()- Change fan mode to manual with fan level 1VeSyncFan.sleep_mode()- Change fan mode to sleepVeSyncFan.change_fan_speed(speed=None)- Change fan speed. Call without speed to toggle to next speedCompatible levels for each model:Core 200S [1, 2, 3]Core 300S/400S [1, 2, 3, 4]PUR131S [1, 2, 3]Vital 100S/200S [1, 2, 3, 4]Levoit Purifier Core200S/300S/400S and Vital 100S/200S PropertiesVeSyncFan.child_lock- Return the state of the child lock (True=On/False=off)VeSyncAir.night_light- Return the state of the night light (on/dim/off)Not available on Vital 100S/200SLevoit Purifier Core200S/300S/400S and Vital 100S/200S MethodsVeSyncFan.child_lock_on()Enable child lockVeSyncFan.child_lock_off()Disable child lockVeSyncFan.turn_on_display()Turn display onVeSyncFan.turn_off_display()Turn display offVeSyncFan.set_night_light('on'|'dim'|'off')- Set night light brightnessVeSyncFan.get_timer()- Get any running timers, stores Timer DataClass inVeSyncFan.timerVeSyncFan.set_timer(timer_duration=3000)- Set a timer for the device, only turns device off. Timer DataClass stored inVeSyncFan.timerVeSyncFan.clear_timer()- Cancel any running timerLevoit Vital 100S/200S Properties and MethodsThe Levoit Vital 100S/200S has additional features not available on other models.VeSyncFan.set_fan_speed- The manual fan speed that is currently set (remains constant when in auto/sleep mode)VeSyncFan.fan_level- Returns the fan level purifier is currently operating on whether in auto/manual/sleep modeVeSyncFan.light_detection- Returns the state of the light detection mode (True=On/False=off)VeSyncFan.light_detection_state- Returns whether light is detected (True/False)VeSyncFan.pet_mode()- Set pet modeNOTE: Only available on Vital 200SVeSyncFan.set_auto_preference(preference='default', room_size=600)- Set the auto mode preference. Preference can be 'default', 'efficient' or quiet. Room size defaults to 600VeSyncFan.set_light_detection_on()- Turn on light detection modeVeSyncFan.set_light_detection_off()- Turn off light detection modeLights API Methods & PropertiesBrightness Light Bulb Method and PropertiesCompatible with all bulbsVeSyncBulb.brightness- Return brightness in percentage (1 - 100)VeSyncBulb.set_brightness(brightness)- Set bulb brightness values from 1 - 100Light Bulb Color Temperature Methods and PropertiesNOTE: only compatible with ESL100CW and Valceno Bulbs, NOT compatible with ESL100MC BulbsVeSyncBulb.color_temp_pct- Return color temperature in percentage (0 - 100)VeSyncBulb.color_temp_kelvin- Return brightness in KelvinVeSyncBulb.set_color_temp(color_temp)- Set white temperature in percentage (0 - 100)Multicolor Light Bulb Methods and PropertiesCompatible with ESL100MC & Valceno BulbsPropertiesVeSyncBulb.color- Returns a Dataclass with HSV and RGB attributes that are named tuplesVeSyncBulb.color.rbg=namedtuple('RGB',['red','green','blue'])VeSyncBulb.color.hsv=namedtuple('HSV',['hue','saturation','value'])VeSyncBulb.color_hsv- Returns a named tuple with HSV valuesVeSyncBulb.color_rgb- Returns a named tuple with RGB valuesVeSyncBulb.color_mode- Return bulb color mode (string values: 'white', 'color', 'hsv')VeSyncBulb.color_hue- Return color hue (float values from 0.0 - 360.0)VeSyncBulb.color_saturation- Return color saturation (float values from 0.0 - 100.0)VeSyncBulb.color_value- Return color value (int values from 0 - 100)The following properties are also still available for backwards compatibilityVeSyncBulb.color_value_hsv- Return color value in HSV named tuple format (hue: float 0.0-360.0, saturation: float 0.0-100.0, value: float 0-100 )VeSyncBulb.color_value_rgb- Return color value in RGB named tuple format (red: float, green: float, blue: float 0-255.0)MethodsVeSyncBulb.set_hsv(hue, saturation, value)Set bulb color in HSV formatArguments: hue (numeric) 0 - 360, saturation (numeric) 0-100, value (numeric) 0-100Returns boolVeSyncBulb.set_rgb(red, green, blue)Set bulb color in RGB formatArguments: red (numeric) 0-255, green (numeric) 0-255, blue (numeric) 0-255Returns boolVeSyncBulb.enable_white_mode()Turn bulb to white mode - returns boolVeSyncBulb.set_color_temp(color_temp)Set bulb white temperature (int values from 0 - 100)Setting this will automatically force the bulb into White modeVeSyncBulb.set_status(brightness, color_temp, color_saturation, color_hue, color_mode color_value)Set every property, in a single callAll parameters are optionalNOTE: Due to the varying API between bulbs, avoid setting thecolor_modeargument directly, instead set colors values withset_hsvorset_rgbto turn on color and useenable_white_mode()to turn off color.Dimmable Switch Methods and PropertiesVeSyncSwitch.brightness- Return brightness of switch in percentage (1 - 100)VeSyncSwitch.indicator_light_status- return status of indicator light on switchVeSyncSwitch.rgb_light_status- return status of rgb light on faceplateVeSyncSwitch.rgb_light_value- return dictionary of rgb light color (0 - 255)VeSyncSwitch.set_brightness(brightness)- Set brightness of switch (1 - 100)VeSyncSwitch.indicator_light_on()- Turn indicator light onVeSyncSwitch.indicator_light_off()- Turn indicator light offVeSyncSwitch.rgb_color_on()- Turn rgb light onVeSyncSwitch.rgb_color_off()- Turn rgb light offVeSyncSwitch.rgb_color_set(red, green, blue)- Set color of rgb light (0 - 255)Levoit Humidifier Methods and PropertiesHumidifier PropertiesThe details dictionary contains all device status detailsVeSyncHumid.details={'humidity':80,# percent humidity in room'mist_virtual_level':0,# Level of mist output 1 - 9'mist_level':0,'mode':'manual',# auto, manual, sleep'water_lacks':False,'humidity_high':False,'water_tank_lifted':False,'display':False,'automatic_stop_reach_target':False,'night_light_brightness':0}The configuration dictionary shows current settingsVeSyncHumid.config={'auto_target_humidity':80,# percent humidity in room'display':True,# Display on/off'automatic_stop':False}The LV600S has warm mist settings that show in the details dictionary in addition to the key/values above.VeSyncLV600S.details={'warm_mist_enabled':True,'warm_mist_level':2}VeSyncHumid.humidity- current humidity level in roomVeSyncHumid.mist_level- current mist levelVeSyncHumid.mode- Mode of operation - sleep, off, auto/humidityVeSyncHumid.water_lacks- Returns True if water is lowVeSyncHumid.auto_humidity- Target humidity for auto modeVeSyncHumid.auto_enabled- Returns true if auto stop enabled at target humidityHumidifer MethodsVeSyncHumid.automatic_stop_on()Set humidifier to stop at set humidityVeSyncHumid.automatic_stop_offSet humidifier to run continuouslyVeSyncHumid.turn_on_display()Turn display onVeSyncHumid.turn_off_display()Turn display offVeSyncHumid.set_humidity(30)Set humidity between 30 and 80 percentVeSyncHumid.set_night_light_brightness(50)Set nightlight brightness between 1 and 100VeSyncHumid.set_humidity_mode('sleep')Set humidity mode - sleep/autoVeSyncHumid.set_mist_level(4)Set mist output 1 - 9600S warm mist featureVeSync600S.warm_mist_enabled- Returns true if warm mist feature is enabledVeSync600S.set_warm_level(2)- Sets warm mist levelCosori DevicesCosori devices are found under themanager.kitchenVeSync class attribute.Cosori 3.7 and 5.8 Quart Air FryerThe Cosori 3.7 and 5.8 Quart Air Fryer has several methods and properties that can be used to monitor and control
the device.This library splits the functionality and status into two classes that are both accessible from the device instance.To maintain consistency of state, the update() method is called after each of the methods that change the state of the device.There is also an instance attribute that can be setVeSyncAirFryer158.refresh_intervalthat will set the interval in seconds that the state of the air fryer should be updated before a method that changes state is called. This is an additional API call but is necessary to maintain state, especially when trying topauseorresumethe device. Defaults to 60 seconds but can be set via:# Change to 120 seconds before status is updated between callsVeSyncAirFryer158.refresh_interval=120# Set status update before every callVeSyncAirFryer158.refresh_interval=0# Disable status update before every callVeSyncAirFryer158.refresh_interval=-1Air Fryer PropertiesAll properties cannot be directly set, they must be set from theget_details()or methods that set the status.
They can be set through theVeSyncAirFryer158.fryer_statusdataclass but should be avoided. This separation of functionality and status is purposeful to avoid inconsistent states.VeSyncAirFryer158.temp_unit- Temperature units of the device (fahrenheitorcelsius)VeSyncAirFryer158.current_temp- Current temperature in the defined temperature units. If device is not running, this defaults toNoneVeSyncAirFryer158.cook_set_temp- Set temperature or target temperature for preheatVeSyncAirFryer158.cook_last_time- The last minutes remaining returned from API for cook modeVeSyncAirFryer158.preheat_last_time- The last minutes remaining returned from API for preheat modeVeSyncAirFryer158.cook_status- Status of air fryer. This can be the following states:standby- Air fryer is off and no cook or preheat is in progresscooking- Air fryer is actively cookingcookStop- Cooking is paused and can be resumedcookEnd- Cooking is ended and can be resumedheating- Air fryer is preheatingpreheatStop- Preheat is paused and can be resumedheatEnd- Preheat is ended and cooking mode can be started withcook_from_preheat()methodVeSyncAirFryer158.is_heating- Returns true if air fryer is preheatingVeSyncAirFryer158.is_cooking- Returns true if air fryer is cookingVeSyncAirFryer158.is_paused- Returns true if air fryer is paused and can be resumedVeSyncAirFryer158.remaining_time- Returns minutes remaining based on timestamp of last API return when air fryer is running. ReturnsNoneif not runningVeSyncAirFryer158.fryer_status- Dataclass that contains the status of the air fryer. The attributes of this Dataclass are directly accessible from theVeSyncAirFryer158properties andshould not be directly set.Air Fryer MethodsVeSyncAirFryer158.update()- Retrieve current statusVeSyncAirFryer158.cook(set_temp: int, set_time: int)- Set air fryer cook mode based on time and temp in defined unitsVeSyncAirFryer158.set_preheat(target_temp: int, cook_time: int)- Set air fryer preheat mode based on time and temp in defined unitsVeSyncAirFryer158.cook_from_preheat()- Start cook mode when air fryer is inpreheatEndstateVeSyncAirFryer158.pause()- Pause air fryer when incookingorheatingstateVeSyncAirFryer158.resume()- Resume air fryer when incookStoporpreheatStopstateVeSyncAirFryer158.end()- End cooking or preheating and return air fryer tostandbystateTimer DataClassThis is the a Timer DataClass that is used in theget_timer()orset_timer()methodsonly 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.Thepause(),resume()andstop()methods for this DataClass only impact the timer locally and do not update the API.frompyvesync.helpersimportTimertimer=Timer(timer_duration=60,id=1)# Get time remaining in seconds# Calculates based on timer elapsed each time property is calledtimer.remaining_time# Get statustimer.status# Get actiontimer.action# Set status - active or donetimer.status='active'# set time remaining in seconds, does not edit statustimer.remaining_time=120# Pause timer - Does not update API - only pauses locallytimer.pause()# End timer -Does not update API - only ends locallytimer.end()# Resume timer - Does not update API - only Resumes locallytimer.start()JSON Output APIThedevice.displayJSON()method outputs properties and status of the deviceJSON Output for All Devicesdevice.displayJSON()#Returns:{"Device Name":"Device 1","Model":"Device Model","Subdevice No":"1","Status":"on","Online":"online","Type":"Device Type","CID":"DEVICE-CID"}JSON Output for Outlets{"Active Time":"1",# in minutes"Energy":"2.4",# today's energy in kWh"Power":"12",# current power in W"Voltage":"120",# current voltage"Energy Week":"12",# totaly energy of week in kWh"Energy Month":"50",# total energy of month in kWh"Energy Year":"89",# total energy of year in kWh}JSON Output for Dimmable SwitchThis output only applies to dimmable switch.  The standard switch has the default device JSON output shownabove{"Indicator Light":"on",# status of indicator light"Brightness":"50",# percent brightness"RGB Light":"on"# status of RGB Light on faceplate}JSON Output for Dimmable Bulb# output for dimmable bulb{# all default outputs plus..."Brightness":"50"# brightness in percent}JSON Output for Tunable Bulb# output for tunable bulb{# all default outputs plus..."Brightness":"50"# brightness in percent"Kelvin":"5400"# white temperature in Kelvin}JSON Output for Multicolor Bulb# output for valceno multicolor bulb{# all default outputs plus..."Brightness":"100",# brightness in percent (also used for color value in hsv mode)"WhiteTemperaturePct":"0",# white temperature in percent"WhiteTemperatureKelvin":"2700",# white temperature in Kelvin"ColorHSV":"hsv(hue=79.99, saturation=90.0, value=100)",# color definition in HSV model"ColorRGB":"rgb(red=178.5, green=255.0, blue=25.5)",# color definition in RGB model"ColorMode":"hsv"# color mode ( white / hsv )}JSON Output for Air Purifier{"Active Time":"50",# minutes"Fan Level":"2",# fan level 1-3"Air Quality":"95",# air quality in percent"Mode":"auto","Screen Status":"on","Filter Life":"99"# remaining filter life in percent}{"Mode":"manual",# auto, manual, sleep"Humidity":20,# percent"Mist Virtual Level":6,# Mist level 1 - 9"Water Lacks":true,# True/False"Water Tank Lifted":true,# True/False"Display":true,# True/False"Automatic Stop Reach Target":true,"Night Light Brightness":10,# 1 - 100"Auto Target Humidity":true,# True/False"Automatic Stop":true# True/False}JSON Output for Core200S Purifier{"Device Name":"MyPurifier","Model":"Core200S","Subdevice No":"None","Status":"on","Online":"online","Type":"wifi-air","CID":"asd_sdfKIHG7IJHGwJGJ7GJ_ag5h3G55","Mode":"manual","Filter Life":"99","Fan Level":"1","Display":true,"Child Lock":false,"Night Light":"off","Display Config":true,"Display_Forever Config":false}JSON Output for 400S Purifier{"Device Name":"MyPurifier","Model":"Core200S","Subdevice No":"None","Status":"on","Online":"online","Type":"wifi-air","CID":"<CID>","Mode":"manual","Filter Life":"100","Air Quality Level":"5","Air Quality Value":"1","Fan Level":"1","Display":true,"Child Lock":false,"Night Light":"off","Display Config":true,"Display_Forever Config":false}JSON Output for 600S Purifier{"Device Name":"My 600s","Model":"LAP-C601S-WUS","Subdevice No":"None","Status":"on","Online":"online","Type":"wifi-air","CID":"<CID>","Mode":"manual","Filter Life":"98","Air Quality Level":"5","Air Quality Value":"1","Fan Level":"3","Display":true,"Child Lock":false,"Night Light":"off","Display Config":true,"Display_Forever Config":false}NotesMore detailed data is available within theVesyncOutletby inspecting theVesyncOutlet.energydictionary.TheVesyncOutlet.energyobject includes 3 nested dictionariesweek,month, andyearthat contain detailed weekly, monthly and yearly dataVesyncOutlet.energy['week']['energy_consumption_of_today']VesyncOutlet.energy['week']['cost_per_kwh']VesyncOutlet.energy['week']['max_energy']VesyncOutlet.energy['week']['total_energy']VesyncOutlet.energy['week']['data']# which itself is a list of valuesDebug modeTo make it easier to debug, there is adebugargument in theVeSyncmethod. This prints out your device list and any other debug log messages.importpyvesync.vesyncasvsmanager=vs.VeSync('user','pass',debug=True)manager.login()manager.update()# Prints device list returned from VesyncRedact modeTo make it easier to post logs online , there is aredactargument in theVeSyncmethod. This redacts any sensitive information from the logs.
The dafault is set to Trueimportpyvesync.vesyncasvsmanager=vs.VeSync('user','pass',debug=True,redact=True)manager.login()manager.update()# Prints device list returned from VesyncFeature RequestsBefore filing an issue to request a new feature or device, please ensure that you will take the time to test the feature throuroughly. New features cannot be simply tested on Home Assistant. A separate integration must be created which is not part of this library. In order to test a new feature, clone the branch and install into a new virtual environment.mkdirpython_test&&cdpython_test# Check Python version is 3.8 or higherpython3--version# or python --version or python3.8 --version# Create a new venvpython3-mvenvpyvesync-venv# Activate the venv on linuxsourcepyvesync-venv/bin/activate# or ....pyvesync-venv\Scripts\activate.ps1# on powershellpyvesync-venv\Scripts\activate.bat# on command prompt# Install branch to be tested into new virtual environmentpipinstallgit+https://github.com/webdjoe/pyvesync@BRANCHNAMETest functionality with a scripttest.pyimportsysimportloggingimportjsonfrompyvesyncimportVeSynclogger=logging.getLogger(__name__)logger.setLevel(logging.DEBUG)USERNAME="YOUR USERNAME"PASSWORD="YOUR PASSWORD"deftest_device():# Instantiate VeSync class and loginmanager=VeSync(USERNAME,PASSWORD,debug=True)ifmanager.login()==False:logger.debug("Unable to login")return# Pull and update devicesmanager.update()fan=Nonelogger.debug(str(manager.fans))fordevinmanager.fans:# Print all device infologger.debug(dev.device_name+"\n")logger.debug(dev.display())# Find correct deviceifdev.device_name.lower()==DEVICE_NAME.lower():fan=devbreakiffan==None:logger.debug("Device not found")logger.debug("Devices found -\n%s",str(manager._dev_list))returnlogger.debug('--------------%s-----------------'%fan.device_name)logger.debug(dev.display())logger.debug(dev.displayJSON())# Test all device methods and functionality# Test Propertieslogger.debug("Fan is on -%s",fan.is_on)logger.debug("Modes -%s",fan.modes)logger.debug("Fan Level -%s",fan.fan_level)logger.debug("Fan Air Quality -%s",fan.air_quality)logger.debug("Screen Status -%s",fan.screen_status)fan.turn_on()fan.turn_off()fan.sleep_mode()fan.auto_mode()fan.manual_mode()fan.change_fan_speed(3)fan.change_fan_speed(2)fan.child_lock_on()fan.child_lock_off()fan.turn_off_display()fan.turn_on_display()fan.set_light_detection_on()logger.debug(fan.light_detection_state)logger.debug(fan.light_detection)# Only on Vital 200Sfan.pet_mode()logger.debug("Set Fan Speed -%s",fan.set_fan_speed)logger.debug("Current Fan Level -%s",fan.fan_level)logger.debug("Current mode -%s",fan.mode)# Display all device infologger.debug(dev.display())logger.debug(dev.displayJSON())if__name__=="__main__":logger.debug("Testing device")test_device()...Device RequestsSSL pinning makes capturing packets much harder. In order to be able to capture packets, SSL pinning needs to be disabled before running an SSL proxy. Use an Android emulator such as Android Studio, which is available for Windows and Linux for free. Download the APK from APKPure or a similiar site and useObjectionorFrida. Followed by capturing the packets with Charles Proxy or another SSL proxy application.Be sure to capture all packets from the device list and each of the possible device menus and actions. Please redact theaccountidandtokenfrom the captured packets. If you feel you must redact other keys, please do not delete them entirely. Replace letters with "A" and numbers with "1", leave all punctuation intact and maintain length.For example:Before:{"tk":"abc123abc123==3rf","accountId":"123456789","cid":"abcdef12-3gh-ij"}After:{"tk":"AAA111AAA111==1AA","accountId":"111111111","cid":"AAAAAA11-1AA-AA"}ContributingAllcontributionsare welcome.This project is licensed underMIT.