Package: pyanova-api
pyanova-apiA Python 3 library for programmatically accessing WiFi-enabled Anova sous vide cookers through the Anova API.NOTE: This library uses the Anova REST API and has been tested with the Anova Precision Cooker Pro. Make sure your Anova cooker supports WiFi and is already connected.pyanova-apidoes not support communication over Bluetooth.Installationpyanova-apican be installed from either PyPi or can be installed manually by cloning the GitHub repository.TL;DR installationpip install pyanova-apiManual installationFirst, clone the GitHub repository:git clone https://github.com/ammarzuberi/pyanova-api.gitEnter the newly createdpyanova-apidirectory and run:pip install .This should installpyanova-apion your system. You can use it in your own Python scripts like so:importanovaCooker IDYou will need your cooker ID to usepyanova-api. This can be easily found in the Anova app when your cooker is connected to WiFi.On the profile page, click the settings button (top right of the page, cog icon) and choose "Cooker Details."UsageTo get started, first import theAnovaCookerclass fromanova.InitializingfromanovaimportAnovaCookercooker=AnovaCooker('your device ID goes here')The code above initializes the cooker into thecookervariable. Simply initializing the cooker object with cooker state does not require authentication with the Anova API, and as such can be used to obtain information about any cooker as long as you have the cooker ID.Setting cooker stateThere are four state variables that can be modified and pushed to the cooker:Cooker on/off (bool)Cook time (in seconds,int)Target temperature (in Celcius,float)Temperature display unit (CorF)Before setting the cooker state, you must authenticate with the Anova API. In the current version ofpyanova-api, only email/password authentication is supported. You can authenticate yourself inpyanova-apilike so:cooker.authenticate('your email address goes here','your password goes here')Once you're authenticated, starting a new cook that will last 2 hours at 55 degrees Celcius will look like this:cooker.cook=Truecooker.cook_time=60*60*2# 2 hours in secondscooker.target_temp=55.0cooker.save()Thecooker.save()method calls the Anova API and starts the cook.The cooker's display unit is the unit used to display temperature in the Anova app and on the cooker itself. This can be changed like so:cooker.temp_display_unit='F'cooker.save()NOTE: The target temperature is always in Celcius. Changing the display temperature does not change this.Getting cooker stateIn addition to the four state variables that can be modified, there are multiple other state variables that can be accessed via the API but are read-only.Before checking the values of state variables, always make sure they are the most current by callingcooker.update_state(). Callingupdate_state()after modifying one of the mutable variables but before callingsave()will cause the changes to be overwritten with the values from the API.All the available state variables are:VariableTypeDescriptionjob_statusstrThe status of the current job, for example,PREHEATING.job_time_remainingintThe number of seconds remaining in the job.heater_duty_cyclefloatThe heater's percentage duty cycle.motor_duty_cyclefloatThe motor's percentage duty cycle.wifi_connectedboolThe cooker's WiFi connection status.wifi_ssidstrThe SSID of the network the cooker is connected to.device_safeboolIs the device is safe to operate?water_leakboolIs there a water leak?water_level_criticalboolIs the water level too low for operation?water_level_lowboolIs the water level low?heater_tempfloatThe heater's temperature in Celcius.triac_tempfloatThe triac's (like a relay) temperature in Celcius.water_tempfloatThe water's temperature in Celcius.These state variables can be accessed like so:cooker.update_state()wifi_ssid=cooker.wifi_ssidwater_temp=cooker.water_temp