Skip to content

Commit 81769d4

Browse files
Support for multiple bricks per model (#613)
Co-authored-by: lucarin91 <lucarin@protonmail.com>
1 parent 4e0f45a commit 81769d4

File tree

148 files changed

+813
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+813
-289
lines changed

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ vars:
1212
GOLANGCI_LINT_VERSION: v2.4.0
1313
GOIMPORTS_VERSION: v0.29.0
1414
DPRINT_VERSION: 0.48.0
15-
EXAMPLE_VERSION: "0.3.1"
16-
RUNNER_VERSION: "0.3.1"
15+
EXAMPLE_VERSION: "0.4.0"
16+
RUNNER_VERSION: "0.4.0"
1717
VERSION: # if version is not passed we hack the semver by encoding the commit as pre-release
1818
sh: echo "${VERSION:-0.0.0-$(git rev-parse --short HEAD)}"
1919

debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.3.1/api-docs/arduino/app_bricks/air_quality_monitor/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/air_quality_monitor/API.md

File renamed without changes.

internal/e2e/daemon/testdata/assets/0.3.1/api-docs/arduino/app_bricks/arduino_iot_cloud/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/arduino_cloud/API.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# arduino_iot_cloud API Reference
1+
# arduino_cloud API Reference
22

33
## Index
44

5-
- Class `ArduinoIoTCloud`
5+
- Class `ArduinoCloud`
66

77
---
88

9-
## `ArduinoIoTCloud` class
9+
## `ArduinoCloud` class
1010

1111
```python
12-
class ArduinoIoTCloud(device_id: str, secret: str, server: str, port: int)
12+
class ArduinoCloud(device_id: str, secret: str, server: str, port: int)
1313
```
1414

15-
Arduino IoT Cloud client for managing devices and data.
15+
Arduino Cloud client for managing devices and data.
1616

1717
### Parameters
1818

1919
- **device_id** (*str*): The unique identifier for the device.
2020
If omitted, uses ARDUINO_DEVICE_ID environment variable.
21-
- **secret** (*str*): The password for Arduino IoT Cloud authentication.
21+
- **secret** (*str*): The password for Arduino Cloud authentication.
2222
If omitted, uses ARDUINO_SECRET environment variable.
23-
- **server** (*str*) (optional): The server address for Arduino IoT Cloud (default: "iot.arduino.cc").
24-
- **port** (*int*) (optional): The port to connect to the Arduino IoT Cloud server (default: 8884).
23+
- **server** (*str*) (optional): The server address for Arduino Cloud (default: "iot.arduino.cc").
24+
- **port** (*int*) (optional): The port to connect to the Arduino Cloud server (default: 8884).
2525

2626
### Raises
2727

@@ -39,7 +39,7 @@ Run a single iteration of the Arduino IoT Cloud client loop, processing commands
3939

4040
#### `register(aiotobj: str | Any)`
4141

42-
Register a variable or object with the Arduino IoT Cloud client.
42+
Register a variable or object with the Arduino Cloud client.
4343

4444
##### Parameters
4545

internal/e2e/daemon/testdata/assets/0.3.1/api-docs/arduino/app_bricks/audio_classifier/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/audio_classification/API.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
# audio_classifier API Reference
1+
# audio_classification API Reference
22

33
## Index
44

5-
- Class `AudioClassifierException`
6-
- Class `AudioClassifier`
5+
- Class `AudioClassificationException`
6+
- Class `AudioClassification`
77

88
---
99

10-
## `AudioClassifierException` class
10+
## `AudioClassificationException` class
1111

1212
```python
13-
class AudioClassifierException()
13+
class AudioClassificationException()
1414
```
1515

16-
Custom exception for AudioClassifier errors.
16+
Custom exception for AudioClassification errors.
1717

1818

1919
---
2020

21-
## `AudioClassifier` class
21+
## `AudioClassification` class
2222

2323
```python
24-
class AudioClassifier(mic: Microphone, confidence: float)
24+
class AudioClassification(mic: Microphone, confidence: float)
2525
```
2626

27-
AudioClassifier module for detecting sounds and classifying audio using a specified model.
27+
AudioClassification module for detecting sounds and classifying audio using a specified model.
2828

2929
### Parameters
3030

@@ -93,6 +93,6 @@ Returns None if no valid classification is found.
9393

9494
##### Raises
9595

96-
- **AudioClassifierException**: If the file cannot be found, read, or processed.
96+
- **AudioClassificationException**: If the file cannot be found, read, or processed.
9797
- **ValueError**: If the file uses an unsupported sample width.
9898

internal/e2e/daemon/testdata/assets/0.3.1/api-docs/arduino/app_bricks/camera_code_detector/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/camera_code_detection/API.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,46 @@
1-
# camera_code_detector API Reference
1+
# camera_code_detection API Reference
22

33
## Index
44

5-
- Class `CameraCodeDetector`
6-
- Class `CameraMultiCodeDetector`
5+
- Class `CameraCodeDetection`
76
- Class `Detection`
87
- Function `utils.draw_bounding_box`
98

109
---
1110

12-
## `CameraCodeDetector` class
11+
## `CameraCodeDetection` class
1312

1413
```python
15-
class CameraCodeDetector(camera: USBCamera, detect_qr: bool, detect_barcode: bool)
14+
class CameraCodeDetection(camera: USBCamera, detect_qr: bool, detect_barcode: bool)
1615
```
1716

18-
Module for detecting a QR code and/or a traditional barcode using a USB camera feed.
17+
Scans a camera video feed for QR codes and/or barcodes.
1918

2019
### Methods
2120

22-
#### `on_detect(callback: Callable[[Image, Detection], None] | None)`
21+
#### `start()`
22+
23+
Start the detector and begin scanning for codes.
24+
25+
#### `stop()`
26+
27+
Stop the detector and release resources.
28+
29+
#### `on_detect(callback: Callable[[Image, list[Detection]], None] | Callable[[Image, Detection], None] | None)`
2330

2431
Registers or removes a callback to be triggered on code detection.
2532

26-
When a QR code or barcode is detected in the camera feed, the provided callback function will be invoked. The callback function should accept the Image frame and a Detection object. If None is provided, the callback is removed.
33+
When a QR code or barcode is detected in the camera feed, the provided callback function will be invoked.
34+
The callback function should accept the Image frame and a list[Detection] or Detection objects. If the former
35+
is used, it will receive all detections at once. If the latter is used, it will be called once for each
36+
detection. If None is provided, the callback will be removed.
2737

2838
##### Parameters
2939

30-
- **callback** (*Callable[[Image, Detection], None]*): A callback that will be called every time a detection is made.
40+
- **callback** (*Callable[[Image, list[Detection]], None]*): A callback that will be called every time a detection
41+
is made with all the detections.
42+
- **callback** (*Callable[[Image, Detection], None]*): A callback that will be called every time a detection is
43+
made with a single detection.
3144
- **callback** (*None*): To unregister the current callback, if any.
3245

3346
##### Examples
@@ -40,40 +53,30 @@ def on_code_detected(frame: Image, detection: Detection):
4053

4154
detector.on_detect(on_code_detected)
4255
```
56+
#### `on_frame(callback: Callable[[Image], None] | None)`
4357

44-
---
45-
46-
## `CameraMultiCodeDetector` class
58+
Registers a callback function to be called when a new camera frame is captured.
4759

48-
```python
49-
class CameraMultiCodeDetector(camera: USBCamera, detect_qr: bool, detect_barcode: bool)
50-
```
60+
The callback function should accept the Image frame.
61+
If None is provided, the callback is removed.
5162

52-
Module for detecting multiple QR codes and/or traditional barcodes using a USB camera feed.
63+
##### Parameters
5364

54-
### Methods
65+
- **callback** (*Callable[[Image], None]*): A callback that will be called with each captured frame.
66+
- **callback** (*None*): Signals to remove the current callback, if any.
5567

56-
#### `on_detect(callback: Callable[[Image, list[Detection]], None] | None)`
68+
#### `on_error(callback: Callable[[Exception], None] | None)`
5769

58-
Registers or removes a callback to be triggered when one or more codes are detected.
70+
Registers a callback function to be called when an error occurs in the detector.
5971

60-
The callback is invoked for each processed video frame that contains at least one detection. The callback function should accept the Image frame and a list of Detection objects, which may include multiple QR codes and/or barcodes. If None is provided, the callback is removed.
72+
The callback function should accept the exception as an argument.
73+
If None is provided, the callback is removed.
6174

6275
##### Parameters
6376

64-
- **callback** (*Callable[[Image, list[Detection]], None] | None*): A function to be called with the current frame and all detections found in it
65-
- **callback** (*None*): To unregister the current callback, if any.
77+
- **callback** (*Callable*): A callback that will be called with the exception raised in the detector.
78+
- **callback** (*None*): Signals to remove the current callback, if any.
6679

67-
##### Examples
68-
69-
```python
70-
def on_codes_detected(frame: Image, detections: list[Detection]):
71-
print(f"Detected {len(detections)} codes")
72-
# Here you can add your code to process the detected codes,
73-
# e.g., draw bounding boxes, save them to a database or log them.
74-
75-
detector.on_detect(on_codes_detected)
76-
```
7780

7881
---
7982

debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.3.1/api-docs/arduino/app_bricks/dbstorage_sqlstore/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/dbstorage_sqlstore/API.md

File renamed without changes.

debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.3.1/api-docs/arduino/app_bricks/dbstorage_tsstore/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/dbstorage_tsstore/API.md

File renamed without changes.

debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.3.1/api-docs/arduino/app_bricks/imageclassification/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/imageclassification/API.md

File renamed without changes.

debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.3.1/api-docs/arduino/app_bricks/keyword_spotter/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/keyword_spotter/API.md

File renamed without changes.

debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.3.1/api-docs/arduino/app_bricks/mood_detector/API.md renamed to debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/assets/0.4.0/api-docs/arduino/app_bricks/mood_detector/API.md

File renamed without changes.

0 commit comments

Comments
 (0)