Package: meater-python
meater-pythonPython wrapper for the Apption Labs Meater cooking probe using v1 of their public API.Installationmeater-pythoncan be installed from either PyPi or can be installed manually by cloning the GitHub repository.TL;DR installationpip install meater-pythonManual installationFirst, clone the GitHub repository:git clone https://github.com/Sotolotl/meater-python.gitEnter the newly createdmeater-pythondirectory and run:pip install .This should installmeater-pythonon your system. You can use it in your own Python scripts like so:importmeaterUsageAll calls to this class are flagged with async, and are awaitable.To get started, first import theMeaterApiclass frommeater.InitializingimportaiohttpfrommeaterimportMeaterApisession=aiohttp.ClientSession()api=MeaterApi(session)The code above initializes the cooker into theapivariable. The api requires an aiohttp session be passed to it. One session should be created for the whole application to use, as per the aiohttp best practices.Before any information can be obtained, you need to authenticate with the api. In the current version ofmeater-python, only email/password authentication is supported. You can authenticate with the API like so:awaitapi.authenticate('<your email address>','<your password>')Getting Probe StatesOnce you have authentiated with the API, you can get information about all available probes like so:devices=awaitapi.get_all_devices()This will populate thedevicesvariable with a list of all the available device objects.NOTE: Only devices that are actively connected to Meater Cloud are available through the API. Once a probe has been disconnected for a few minutes, it is no longer returned by the API.A specific device can be queried by the API like so:device=awaitapi.get_device('<your device ID>')The device ID should be a 65 character long alphanumeric string. To obtain the device ID, make a call toapi.get_all_deviceswhile the device is connected.NOTE: This method will throw an exception if the device cannot be found. This includes if the device is currently offline.MeaterProbe Object AttributesThe following arrtibutes are available on the MeaterProbe objectAttributeTypeDescriptionidstrThe ID of the deviceinternal_temperaturefloatThe internal temperature reading of the probe in â„ƒambient_temperaturefloatThe ambient temperature reading of the probe in â„ƒtime_updateddatetimeThe time that the probes values were last sent to the Meater cloudcookMeaterCook (see below)A MeaterCook class containing information about the current cook. If no cook is running, this will beNoneThe following attributes are available on the MeaterCook objectAttributeTypeDescriptionidstrThe ID of the cooknamestrThe name of the cookstatestrThe current state of the cooktarget_temperaturefloatThe target temperature for this cook in â„ƒpeak_temperaturefloatThe peak temperature so far for this cook in â„ƒtime_remainingintThe time remaining for this cook in secondstime_elapsedintHow long has elapsed since the start of the cook in secondsTroubleshootingDevices will only be returned after the following criteria is met. There may be a delay between the MEATER Cloud seeing your device and it being returned in this endpoint.Device must be seen by the MEATER Cloud. Ensure you've completed a cook while connected to MEATER Cloud.The MEATER app or Block must have an active Bluetooth connection with the device.The MEATER app or Block must have an active MEATER Cloud connection.If you make requests to the Meater API too quickly, you may be subject to rate-limiting. The reccomended rate is 2 requests per 60 seconds, and the maximum is 60 requests per 60 seconds.Requests are automatically slowed down once 10% of rate limit is reached, to 1.0 second per request.