Skip to content

Commit 2ec5723

Browse files
committed
feat: add auto_start configuration, default to true
1 parent 253275c commit 2ec5723

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ The following attributes are available for `viam-demo:refill-controller:refiller
2424
| `camera_name` | string | Required | N/A | The name of the camera component to use to get images. |
2525
| `motor_name` | string | Required | N/A | The name of the motor component to use to dispense snacks. |
2626
| `vision_name` | string | Required | N/A | The name of the vision service to use to get classifications using the image from the camera. |
27-
| `confidence_level` | number | Optional | 0.55 | Number between 0 and 1 as a minimum percentage of confidence for the returned classifications from the vision service |
27+
| `confidence_level` | number | Optional | 0.55 | Number between 0 and 1 as a minimum percentage of confidence for the returned classifications from the vision service. |
28+
| `auto_start` | boolean | Optional | true | Set the control loop to automatically start when the machine is powered on. |
2829

2930
### Example configuration
3031

src/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
LOGGER = getLogger("refill-controller")
2121

22+
__VERSION__ = "0.2.0"
23+
2224

2325
class Refiller(Generic, EasyResource):
2426
MODEL: ClassVar[Model] = Model(
@@ -104,6 +106,7 @@ def reconfigure(
104106
self.vision = cast(Vision, vision_resource)
105107

106108
self.confidence_level = float(attrs.get("confidence_level", 0.55))
109+
self.auto_start = bool(attrs.get("auto_start", True))
107110

108111
if self.auto_start:
109112
self.start()

0 commit comments

Comments
 (0)