Edbot

Support Template

Introduction

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.

Package installation

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.

API Changes

Function names

The following function names have changed:

>>> get_edbot_names()
>>> get_edbot()

to:

>>> 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:

>>> get_robot_names("edbot")

Default robot

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:

>>> get_robot("Bob")

Returned data

The data dictionary is returned from the following API call:

>>> get_data()

This data structure has changed:

  1. The edbots key has been renamed to robots.

  2. The global bypass key has been removed. Instead the per-robot activeUser is set to None if bypassed.

  3. A new initComplete key indicates when the initial robot data has been returned.

  4. A new server key points to a dictionary with version and platform keys.

  5. The robot model key is now a dictionary with keys name, type and key.

  6. Hyphens have been removed from keys to make JavaScript processing easier (the hyphen can be interpreted as a minus sign):

    • speech-current-wordspeechCurrentWord

    • speech-completespeechComplete

    • motion-completemotionComplete

  7. The colours key has been removed. This is static data you can initialise in your own program.

  8. 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.