The Edbot Software version 5.0 is a major release targeting more platforms and more coding languages than ever before. The underlying Web-based API has been updated to accommodate some of these new languages. Similarly the Python API has been updated to fit the new protocols. The changes are outlined below. Read this document in conjunction with the latest Edbot Python API.
Previous edbot Python package releases are not compatible with the Edbot Software version 5.0.
You'll need to install the new edbot Python package published through PyPI. You can install it with easy_install or pip. Using pip on the command line:
pip install edbot
If you've already installed it, run the following command to make sure you have the latest version:
pip install --upgrade edbot
If you’re using Thonny, follow the instructions in this article to add or update the edbot package.
The following function names have changed:
>>> get_edbot_names() >>> get_edbot()
>>> get_robot_names() >>> get_robot()
In addition you can now filter the robot names by model in the call to get_robot_names . Currently recognised model keys are "edbot" and "dream". To get an array of all Edbot names configured on the server, use:
Previous versions of the Python API used the concept of a default robot. Subsequent API calls then operated on the default robot. For example:
>>> set_edbot_name("Bob") >>> get_edbot()
This behaviour is not thread-safe and has few benefits. As a result the set_edbot_name function has been removed. You now simply pass the robot name as the first parameter to the appropriate function:
The data dictionary is returned from the following API call:
This data structure has changed:
The edbots key has been renamed to robots.
The global bypass key has been removed. Instead the per-robot activeUser is set to None if bypassed.
A new initComplete key indicates when the initial robot data has been returned.
A new server key points to a dictionary with version and platform keys.
The robot model key is now a dictionary with keys name, type and key.
speech-current-word → speechCurrentWord
speech-complete → speechComplete
motion-complete → motionComplete
The colours key has been removed. This is static data you can initialise in your own program.
The motions key has been removed. This has been replaced by 2 new API calls:
>>> get_motions("Bob") >>> get_default_motions("edbot")
See the Edbot Python API for more details.