Skip to content

Commit

Permalink
Add new battery_charged event type reason
Browse files Browse the repository at this point in the history
When the battery of a device is too low, the service yields the
`unavailable` event type with the `low_battery` reason. Then the
device may charge itself (for example because it has been plugged to a
charging dock by the last customer, or because the device has a solar
panel). Once the battery is charged enough, the service can yield an
`available` event type with the `battery_charged` reason.

[closes #210]
  • Loading branch information
dbaty authored and Hervé Cauwelier committed Feb 13, 2019
1 parent 4dab03f commit d12b774
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions agency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ List of valid vehicle events and the resulting vehicle status if the event is su
| `event_type` | description | valid initial `status` | `status` on success | status_description |
| ---------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------- | ------------------- | ----------------------------------------------------------------------- |
| `service_start` | Vehicle introduced into service at the beginning of the day (if program does not operate 24/7) | `unavailable`, `removed`, `elsewhere` | `available` | Vehicle is on the street and available for customer use. |
| `battery_charged` | A vehicle becomes available because its battery is charged enough | `unavailable` | `available` | |
| `trip_end` | Customer ends trip and reservation | `trip` | `available` | |
| `rebalance_drop_off` | Vehicle moved for rebalancing | `removed` | `available` | |
| `maintenance_drop_off` | Vehicle introduced into service after being removed for maintenance | `removed` | `available` | |
Expand Down
1 change: 1 addition & 0 deletions generate_schema/provider/status_changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
},
"event_type_reason": {
"enum": [
"battery_charged",
"service_start",
"user_drop_off",
"rebalance_drop_off",
Expand Down
1 change: 1 addition & 0 deletions provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ When multiple query parameters are specified, they should all apply to the retur
| `event_type` | Description | `event_type_reason` | Description |
| ---------- | ---------------------- | ------- | ------------------ |
| `available` | A device becomes available for customer use | `service_start` | Device introduced into service at the beginning of the day (if program does not operate 24/7) |
| | | `battery_charged` | A device becomes available because its battery is charged enough |
| | | `user_drop_off` | User ends reservation |
| | | `rebalance_drop_off` | Device moved for rebalancing |
| | | `maintenance_drop_off` | Device introduced into service after being removed for maintenance |
Expand Down
3 changes: 2 additions & 1 deletion provider/status_changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
},
"event_type_reason": {
"enum": [
"battery_charged",
"service_start",
"user_drop_off",
"rebalance_drop_off",
Expand Down Expand Up @@ -400,4 +401,4 @@
}
},
"additionalProperties": false
}
}

0 comments on commit d12b774

Please sign in to comment.