From 64c0986203e90f6061ba1bddd509943f5ebaf671 Mon Sep 17 00:00:00 2001 From: Damien Baty Date: Wed, 13 Feb 2019 08:23:23 +0100 Subject: [PATCH] Add new `battery_charged` event type reason 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] --- agency/README.md | 1 + generate_schema/provider/status_changes.json | 1 + provider/README.md | 1 + provider/status_changes.json | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/agency/README.md b/agency/README.md index 4428b26c3..4115e3afc 100644 --- a/agency/README.md +++ b/agency/README.md @@ -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` | | diff --git a/generate_schema/provider/status_changes.json b/generate_schema/provider/status_changes.json index ed66c4894..1a1683e79 100644 --- a/generate_schema/provider/status_changes.json +++ b/generate_schema/provider/status_changes.json @@ -120,6 +120,7 @@ }, "event_type_reason": { "enum": [ + "battery,_charged", "service_start", "user_drop_off", "rebalance_drop_off", diff --git a/provider/README.md b/provider/README.md index be5de24dc..285e7fd04 100644 --- a/provider/README.md +++ b/provider/README.md @@ -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 | diff --git a/provider/status_changes.json b/provider/status_changes.json index f38c78e02..984644511 100644 --- a/provider/status_changes.json +++ b/provider/status_changes.json @@ -311,6 +311,7 @@ }, "event_type_reason": { "enum": [ + "battery_charged", "service_start", "user_drop_off", "rebalance_drop_off", @@ -400,4 +401,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +}