diff --git a/README.md b/README.md index 5a93a0e..4ed2587 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,6 @@ python3 -m pip install paho-mqtt ``` ## :seedling: Getting Started -Import `main.py` and create an instance of the Farmbot class: -``` -from main.py import Farmbot -bot = Farmbot() -``` ### Get your authentication token To generate your authentication token and get started: @@ -69,23 +64,26 @@ bot.get_token('email', 'password', 'server') > Functions marked with [API] communicate with the Farm Designer web app via the [REST API](https://developer.farm.bot/v15/docs/web-app/rest-api.html) and those marked with [BROKER] communicate with the FarmBot via the [message broker](https://developer.farm.bot/v15/docs/message-broker). | Authentication | Description | -| --- | --- | +| :--- | :--- | | [API] `get_token()` | Generate user authentication token using your email and password. Server is https://my.farm.bot by default. | | Publishing | Description | -| --- | --- | +| :--- | :--- | | [API] `request()` | Send requests to the API using various methods. | | [BROKER] `publish()` | Publish messages containing CeleryScript via the message broker. | +> [!CAUTION] +> Making requests other than `GET` to the API will permanently alter the data in your account. `DELETE` and `POST` requests may destroy data that cannot be recovered. Altering data through the API may cause account instability. + | Subscriptions | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `connect()` | Establish persistent connection with the message broker. | | [BROKER] `disconnect()` | Disconnect from the message broker. | | [BROKER] `start_listening()` | Establish persistent subscription to message broker channels. | | [BROKER] `stop_listening()` | End subscription to all message broker channels. | | Basic Commands | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `wait()` | Pauses execution for a certain number of milliseconds. | | [BROKER] `e_stop()` | Emergency locks (E-stops) the Farmduino microcontroller and resets peripheral pins to OFF. | | [BROKER] `unlock()` | Unlocks a locked (E-stopped) device. | @@ -93,13 +91,13 @@ bot.get_token('email', 'password', 'server') | [BROKER] `shutdown()` | description | | Camera | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `calibrate_camera()` | Performs camera calibration. This action will reset camera calibration settings. | | [BROKER] `take_photo()` | Takes a photo using the device camera and uploads it to the web app. | | [BROKER] `photo_grid()` | Returns metadata object about point grid required to perform a scan of the full garden. | | Information | Description | -| --- | --- | +| :--- | :--- | | [API] `get_info()` | Get information about a specific endpoint. | | [API] `set_info()` | Change information contained within an endpoint. | | [API] `safe_z()` | Returns the highest safe point along the z-axis. | @@ -109,27 +107,24 @@ bot.get_token('email', 'password', 'server') | [BROKER] `read_status()` | Returns the FarmBot status tree. | | [BROKER] `read_sensor()` | description | -> [!CAUTION] -> Making requests other than `GET` to the API will permanently alter the data in your account. `DELETE` and `POST` requests may destroy data that cannot be recovered. Altering data through the API may cause account instability. - > [!NOTE] > Not sure which endpoint to access? [Find the list here](https://developer.farm.bot/v15/docs/web-app/api-docs). | Jobs | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `get_job()` | description | | [BROKER] `set_job()` | description | | [BROKER] `complete_job()` | description | | Messages | Description | -| --- | --- | +| :--- | :--- | | [API] `log()` | description | | [BROKER] `message()` | description | | [BROKER] `debug()` | description | | [BROKER] `toast()` | description | | Movement | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `move()` | description | | [BROKER] `set_home()` | description | | [BROKER] `find_home()` | description | @@ -138,7 +133,7 @@ bot.get_token('email', 'password', 'server') | [BROKER] `check_position()` | description | | Peripherals | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `control_servo()` | description | | [BROKER] `control_peripheral()` | description | | [BROKER] `toggle_peripheral()` | description | @@ -146,7 +141,7 @@ bot.get_token('email', 'password', 'server') | [BROKER] `off()` | description | | Resources | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `mark_point()` | description | | [BROKER] `sort_points()` | description | | [BROKER] `sequence()` | description | @@ -158,7 +153,7 @@ bot.get_token('email', 'password', 'server') | [BROKER] `assertion()` | description | | Tools | Description | -| --- | --- | +| :--- | :--- | | [BROKER] `verify_tool()` | Verifies if a tool is mounted to the UTM. | | [BROKER] `mount_tool()` | Mounts given tool and pulls it out of slot. | | [BROKER] `dismount_tool()` | Dismounts currently mounted tool into assigned slot. |