Skip to content

Commit 232ed81

Browse files
update readme
1 parent b6d7dec commit 232ed81

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

README.md

+21-15
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ bot.set_verbosity(2)
9494
| `1` A description of the action will be output with any additional results data. | `Emergency stopping device` |
9595
| `2` The name of the function and the timestamp will be output. | `'e_stop()' called at: 2024-08-21 11:16:18.547813` |
9696

97+
### Configure timeouts
98+
99+
If you expect movements to take longer than the default timeout duration of 120 seconds, you can increase the movement timeout via:
100+
```python
101+
bot.set_timeout(240, "movements")
102+
```
103+
97104
### Test 1: Add a new plant to your garden
98105

99106
This test will help familiarize you with sending commands via the [API](https://developer.farm.bot/docs/rest-api).
@@ -147,13 +154,12 @@ sidecar-starter-pack/
147154

148155
### api.py
149156

150-
| class `ApiConnect()` | Description |
151-
| :--- | :--- |
152-
| `get_token()` | Get FarmBot authorization token. Server is "https://my.farm.bot" by default. |
153-
| `set_token()` | Set FarmBot authorization token. |
154-
| `check_token()` | Ensure the token persists throughout sidecar. |
155-
| `request_handling()` | Handle errors associated with different endpoint errors. |
156-
| `request()` | Make requests to API endpoints using different methods. |
157+
|`main`| class `ApiConnect()` | Description |
158+
|:---:|:---|:---|
159+
|*| `get_token()` | Get FarmBot authorization token. Server is "https://my.farm.bot" by default. |
160+
| | `check_token()` | Ensure the token persists throughout sidecar. |
161+
| | `request_handling()` | Handle errors associated with different endpoint errors. |
162+
| | `request()` | Make requests to API endpoints using different methods. |
157163

158164
### basic_commands.py
159165

@@ -167,14 +173,14 @@ sidecar-starter-pack/
167173

168174
### broker.py
169175

170-
| class `BrokerConnect()` | Description |
171-
| :--- | :--- |
172-
| `connect()` | Establish a persistent connection to send messages via the message broker. |
173-
| `disconnect()` | Disconnect from the message broker. |
174-
| `publish()` | Publish messages containing CeleryScript via the message broker. |
175-
| `start_listen()` | Establish persistent subscription to message broker channels. |
176-
| `stop_listen()` | End subscription to all message broker channels. |
177-
| `listen()` | Listen to a message broker channel for the provided duration in seconds. |
176+
|`main`| class `BrokerConnect()` | Description |
177+
|:---:|:---|:---|
178+
|*| `connect()` | Establish a persistent connection to send messages via the message broker. |
179+
|*| `disconnect()` | Disconnect from the message broker. |
180+
|*| `publish()` | Publish messages containing CeleryScript via the message broker. |
181+
| | `start_listen()` | Establish persistent subscription to message broker channels. |
182+
| | `stop_listen()` | End subscription to all message broker channels. |
183+
|*| `listen()` | Listen to a message broker channel for the provided duration in seconds. |
178184

179185
### camera.py
180186

farmbot_sidecar_starter_pack/main.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
from .functions.resources import Resources
1616
from .functions.tools import ToolControls
1717

18-
VERSION = "1.2.0"
18+
VERSION = "1.3.0"
19+
1920

2021
class Farmbot():
2122
"""Farmbot class."""
@@ -49,16 +50,16 @@ def set_timeout(self, duration, key="listen"):
4950
else:
5051
self.state.timeout[key] = duration
5152

53+
def set_token(self, token):
54+
"""Set FarmBot authorization token."""
55+
self.state.token = token
56+
5257
# api.py
5358

5459
def get_token(self, email, password, server="https://my.farm.bot"):
5560
"""Get FarmBot authorization token. Server is 'https://my.farm.bot' by default."""
5661
return self.api.get_token(email, password, server)
5762

58-
def set_token(self, token):
59-
"""Set FarmBot authorization token."""
60-
self.state.token = token
61-
6263
# basic_commands.py
6364

6465
def wait(self, duration):

0 commit comments

Comments
 (0)