docs: README and API updates about APIs

This commit is contained in:
gak 2023-10-25 15:49:57 +11:00
parent 514e8ec134
commit 463355ce2d
No known key found for this signature in database
3 changed files with 231 additions and 241 deletions

444
API.md
View file

@ -1,249 +1,237 @@
# Tesla API Matrix # Tesla API Matrix
List of all known Tesla APIs, and if this crate supports it, and which of the Tesla enpoints support them. List of all known Tesla APIs (official and unofficial) and if [Teslatte](https://github.com/gak/teslatte) supports it. Some of the Owners API endpoints aren't listed here because they are not currently planned.
As of right now, I am not able to test the two official APIs because my request to use the APIs were rejected.
## APIs
* **Owners API:** A HTTP/REST API (`owner-api.teslamotors.com`) that is used by the Tesla mobile app. It is unofficial and not supported by Tesla. It can access and send commands to vehicles and energy products. The API is reverse engineered by the community, where the Owners API listed below is from the [timdorr/tesla-api](https://github.com/timdorr/tesla-api) repository. Specifically it scrapes the [ownerapi_endpoints.json](https://github.com/timdorr/tesla-api/blob/master/ownerapi_endpoints.json).
* **Fleet API:** Tesla's official HTTP/REST API (released late 2023). The API details are scraped from the [Fleet API documentation](https://developer.tesla.com/docs/fleet-api). The URI paths look identical to the Owners API, except for the domains used, and that it is only for vehicles.
* **Command Mode:** Tesla's official SDK for sending commands to the vehicle (released late 2023). This interface uses Protocol Buffers. There is a [Go repository for the SDK](https://github.com/teslamotors/vehicle-command/) which also includes a proxy for the Fleet API. Unfortunately they have not yet released the protobuf sources, just generated code.
## Notes
This list is automatically generated by the `tesla_api_coverage` tool in this repository. It still needs cleaning up. Some of these items listed might be duplicates, wrong, the API is unknown, or won't be implemented. Please create an issue if you spot any errors.
## API Coverage
### Legend ### Legend
- ✅ Supported by Teslatte - ✅ Supported by Teslatte.
- 🔴 API exists but not supported by Teslatte - 🔴 API exists but not supported by Teslatte.
- Blank - API doesn't exist - API doesn't exist.
Currently only the Owner API is partially supported by this crate. Currently only the Owner API is partially supported by this crate.
<!-- tesla_api_coverage start table --> <!-- tesla_api_coverage start table -->
| API | Owners API (timdorr) | Fleet API | Command Mode | | API | Owners API | Fleet API | Command Mode |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| actuate-trunk | 🔴 | 🔴 | | | actuate-trunk | 🔴 | 🔴 | |
| add-key | 🔴 | | 🔴 | | add-key | 🔴 | | 🔴 |
| add-key-request | | | 🔴 | | add-key-request | | | 🔴 |
| add-managed-charging-site | 🔴 | | | | add-managed-charging-site | 🔴 | | |
| adjust-volume | 🔴 | 🔴 | | | adjust-volume | 🔴 | 🔴 | |
| app-feedback-entitlements | 🔴 | | | | app-feedback-entitlements | 🔴 | | |
| app-feedback-logs | 🔴 | | | | app-feedback-logs | 🔴 | | |
| app-feedback-metadata | 🔴 | | | | app-feedback-metadata | 🔴 | | |
| auto-conditioning-start | ✅ | 🔴 | 🔴 | | auto-conditioning-start | ✅ | 🔴 | 🔴 |
| auto-conditioning-stop | ✅ | 🔴 | | | auto-conditioning-stop | ✅ | 🔴 | |
| autosecure-modelx | | | 🔴 | | autosecure-modelx | | | 🔴 |
| backup-key | | 🔴 | | | backup-key | | 🔴 | |
| backup-reserve | 🔴 | | | | backup-reserve | 🔴 | | |
| calendar-history-data | 🔴 | | | | calendar-history-data | 🔴 | | |
| calendar-sync | 🔴 | | | | calendar-sync | 🔴 | | |
| cancel-software-update | 🔴 | 🔴 | 🔴 | | cancel-software-update | 🔴 | 🔴 | 🔴 |
| charge-max-range | ✅ | 🔴 | | | charge-max-range | ✅ | 🔴 | |
| charge-port-door-close | ✅ | 🔴 | 🔴 | | charge-port-door-close | ✅ | 🔴 | 🔴 |
| charge-port-door-open | ✅ | 🔴 | 🔴 | | charge-port-door-open | ✅ | 🔴 | 🔴 |
| charge-standard | ✅ | 🔴 | | | charge-standard | ✅ | 🔴 | |
| charge-start | ✅ | 🔴 | 🔴 | | charge-start | ✅ | 🔴 | 🔴 |
| charge-stop | ✅ | 🔴 | 🔴 | | charge-stop | ✅ | 🔴 | 🔴 |
| charging-sessions-only-for-business-fleet-owners | | 🔴 | | | charging-sessions-only-for-business-fleet-owners | | 🔴 | |
| check-energy-product-registration | 🔴 | | | | check-energy-product-registration | 🔴 | | |
| climate-off | | | 🔴 | | climate-off | | | 🔴 |
| climate-on | | | 🔴 | | climate-on | | | 🔴 |
| climate-set-temp | | | 🔴 | | climate-set-temp | | | 🔴 |
| create-energy-site-share-invite | 🔴 | | | | create-energy-site-share-invite | 🔴 | | |
| dashcam-save-clip | 🔴 | | | | dashcam-save-clip | 🔴 | | |
| deactivate-device-token | 🔴 | | | | deactivate-device-token | 🔴 | | |
| door-lock | ✅ | 🔴 | | | door-lock | ✅ | 🔴 | |
| door-unlock | ✅ | 🔴 | | | door-unlock | ✅ | 🔴 | |
| drive | | | 🔴 | | drive | | | 🔴 |
| driving-plan | 🔴 | | | | driving-plan | 🔴 | | |
| energy-event | 🔴 | | | | energy-event | 🔴 | | |
| energy-register-product | 🔴 | | | | energy-register-product | 🔴 | | |
| energy-site-backup-time-remaining | 🔴 | | | | energy-site-backup-time-remaining | 🔴 | | |
| energy-site-command | 🔴 | | | | energy-site-command | 🔴 | | |
| energy-site-enroll-program | 🔴 | | | | energy-site-enroll-program | 🔴 | | |
| energy-site-import-export-config | 🔴 | | | | energy-site-import-export-config | 🔴 | | |
| energy-site-onboarding-tips | 🔴 | | | | energy-site-onboarding-tips | 🔴 | | |
| energy-site-opt-event | 🔴 | | | | energy-site-opt-event | 🔴 | | |
| energy-site-preference | 🔴 | | | | energy-site-preference | 🔴 | | |
| energy-site-program-details | 🔴 | | | | energy-site-program-details | 🔴 | | |
| energy-site-programs | 🔴 | | | | energy-site-programs | 🔴 | | |
| energy-site-telemetry-history | 🔴 | | | | energy-site-telemetry-history | 🔴 | | |
| energy-site-user-settings | 🔴 | | | | energy-site-user-settings | 🔴 | | |
| energy-sites-calendar-history | ✅ | | | | energy-sites-calendar-history | ✅ | | |
| energy-sites-live-status | ✅ | | | | energy-sites-live-status | ✅ | | |
| energy-sites-site-info | ✅ | | | | energy-sites-site-info | ✅ | | |
| energy-sites-site-status | ✅ | | | | energy-sites-site-status | ✅ | | |
| energy-wall-connector-firmware-download-url | 🔴 | | | | energy-wall-connector-firmware-download-url | 🔴 | | |
| erase-user-data | | 🔴 | | | erase-user-data | | 🔴 | |
| feature-config | 🔴 | 🔴 | | | feature-config | 🔴 | 🔴 | |
| fetch-energy-site-share-invites | 🔴 | | | | fetch-energy-site-share-invites | 🔴 | | |
| fetch-energy-site-shared-users | 🔴 | | | | fetch-energy-site-shared-users | 🔴 | | |
| fetch-vehicle-shared-drivers | 🔴 | | | | fetch-vehicle-shared-drivers | 🔴 | | |
| flash-lights | ✅ | 🔴 | 🔴 | | flash-lights | ✅ | 🔴 | 🔴 |
| frunk-open | | | 🔴 | | frunk-open | | | 🔴 |
| get | | | 🔴 | | get | | | 🔴 |
| get-charge-on-solar-feature | 🔴 | | | | get-charge-on-solar-feature | 🔴 | | |
| get-managed-charging-sites | 🔴 | | | | get-managed-charging-sites | 🔴 | | |
| get-ownership-xp-config | 🔴 | | | | get-ownership-xp-config | 🔴 | | |
| get-upcoming-service-visit-data | 🔴 | | | | get-upcoming-service-visit-data | 🔴 | | |
| guest-mode | | 🔴 | | | guest-mode | | 🔴 | |
| hermes-authorization | 🔴 | | | | hermes-authorization | 🔴 | | |
| hermes-vehicle-authorization | 🔴 | | | | hermes-vehicle-authorization | 🔴 | | |
| honk-horn | ✅ | 🔴 | 🔴 | | honk-horn | ✅ | 🔴 | 🔴 |
| list-keys | | | 🔴 | | list-keys | | | 🔴 |
| lock | | | 🔴 | | lock | | | 🔴 |
| mattermost | 🔴 | | | | mattermost | 🔴 | | |
| me | 🔴 | 🔴 | | | me | 🔴 | 🔴 | |
| media-next-fav | 🔴 | 🔴 | | | media-next-fav | 🔴 | 🔴 | |
| media-next-track | 🔴 | 🔴 | | | media-next-track | 🔴 | 🔴 | |
| media-prev-fav | 🔴 | 🔴 | | | media-prev-fav | 🔴 | 🔴 | |
| media-prev-track | 🔴 | 🔴 | | | media-prev-track | 🔴 | 🔴 | |
| media-set-volume | | | 🔴 | | media-set-volume | | | 🔴 |
| media-toggle-playback | 🔴 | 🔴 | | | media-toggle-playback | 🔴 | 🔴 | |
| media-volume-down | 🔴 | 🔴 | | | media-volume-down | 🔴 | 🔴 | |
| media-volume-up | 🔴 | | | | media-volume-up | 🔴 | | |
| message-center-message | 🔴 | | | | message-center-message | 🔴 | | |
| message-center-message-action-update | 🔴 | | | | message-center-message-action-update | 🔴 | | |
| message-center-message-count | 🔴 | | | | message-center-message-count | 🔴 | | |
| message-center-message-list | 🔴 | | | | message-center-message-list | 🔴 | | |
| mobile-enabled | | 🔴 | | | mobile-enabled | | 🔴 | |
| navigation-gps-request | 🔴 | 🔴 | | | navigation-gps-request | 🔴 | 🔴 | |
| navigation-request | | 🔴 | | | navigation-request | | 🔴 | |
| navigation-route | 🔴 | | | | navigation-route | 🔴 | | |
| navigation-sc-request | 🔴 | 🔴 | | | navigation-sc-request | 🔴 | 🔴 | |
| nearby-charging-sites | 🔴 | 🔴 | | | nearby-charging-sites | 🔴 | 🔴 | |
| off-grid-vehicle-charging-reserve | 🔴 | | | | off-grid-vehicle-charging-reserve | 🔴 | | |
| onboarding-experience | 🔴 | | | | onboarding-experience | 🔴 | | |
| onboarding-experience-page | 🔴 | | | | onboarding-experience-page | 🔴 | | |
| operation-mode | 🔴 | | | | operation-mode | 🔴 | | |
| orders | 🔴 | 🔴 | | | orders | 🔴 | 🔴 | |
| ping | | | 🔴 | | ping | | | 🔴 |
| place-suggestions | 🔴 | | | | place-suggestions | 🔴 | | |
| plan-trip | 🔴 | | | | plan-trip | 🔴 | | |
| post | | | 🔴 | | post | | | 🔴 |
| powerwall-energy-history | ✅ | | | | powerwall-energy-history | ✅ | | |
| powerwall-order-page | 🔴 | | | | powerwall-order-page | 🔴 | | |
| powerwall-order-session-data | 🔴 | | | | powerwall-order-session-data | 🔴 | | |
| powerwall-status | ✅ | | | | powerwall-status | ✅ | | |
| product-info | | | 🔴 | | product-info | | | 🔴 |
| products | ✅ | | | | products | ✅ | | |
| public-key | | 🔴 | | | public-key | | 🔴 | |
| rate-tariffs | 🔴 | | | | rate-tariffs | 🔴 | | |
| redeem-energy-site-share-invite | 🔴 | | | | redeem-energy-site-share-invite | 🔴 | | |
| redeem-vehicle-share-invite | 🔴 | | | | redeem-vehicle-share-invite | 🔴 | | |
| referral-data | 🔴 | | | | referral-data | 🔴 | | |
| referral-page | 🔴 | | | | referral-page | 🔴 | | |
| region | | 🔴 | | | region | | 🔴 | |
| register | | 🔴 | | | register | | 🔴 | |
| release-notes | 🔴 | | | | release-notes | 🔴 | | |
| remote-auto-seat-climate-request | 🔴 | 🔴 | | | remote-auto-seat-climate-request | 🔴 | 🔴 | |
| remote-auto-steering-wheel-heat-climate-request | 🔴 | 🔴 | | | remote-auto-steering-wheel-heat-climate-request | 🔴 | 🔴 | |
| remote-boombox | 🔴 | 🔴 | | | remote-boombox | 🔴 | 🔴 | |
| remote-seat-cooler-request | 🔴 | 🔴 | | | remote-seat-cooler-request | 🔴 | 🔴 | |
| remote-seat-heater-request | 🔴 | 🔴 | | | remote-seat-heater-request | 🔴 | 🔴 | |
| remote-start-drive | ✅ | 🔴 | | | remote-start-drive | ✅ | 🔴 | |
| remote-steering-wheel-heat-level-request | 🔴 | 🔴 | | | remote-steering-wheel-heat-level-request | 🔴 | 🔴 | |
| remote-steering-wheel-heater-request | 🔴 | 🔴 | | | remote-steering-wheel-heater-request | 🔴 | 🔴 | |
| remove-energy-site-share-user | 🔴 | | | | remove-energy-site-share-user | 🔴 | | |
| remove-key | | | 🔴 | | remove-key | | | 🔴 |
| remove-managed-charging-site | 🔴 | | | | remove-managed-charging-site | 🔴 | | |
| remove-vehicle-share-driver | 🔴 | | | | remove-vehicle-share-driver | 🔴 | | |
| rename-key | | | 🔴 | | rename-key | | | 🔴 |
| reset-pin-to-drive-pin | | 🔴 | | | reset-pin-to-drive-pin | | 🔴 | |
| reset-valet-pin | 🔴 | 🔴 | | | reset-valet-pin | 🔴 | 🔴 | |
| retrieve-notification-preferences | 🔴 | | | | retrieve-notification-preferences | 🔴 | | |
| reverse-geocoding | 🔴 | | | | reverse-geocoding | 🔴 | | |
| revoke-energy-site-share-invite | 🔴 | | | | revoke-energy-site-share-invite | 🔴 | | |
| revoke-vehicle-share-invite | 🔴 | | | | revoke-vehicle-share-invite | 🔴 | | |
| roadside-assistance-data | 🔴 | | | | roadside-assistance-data | 🔴 | | |
| roadside-assistance-page | 🔴 | | | | roadside-assistance-page | 🔴 | | |
| schedule-software-update | 🔴 | 🔴 | | | schedule-software-update | 🔴 | 🔴 | |
| seat-heater | | | 🔴 | | seat-heater | | | 🔴 |
| send-device-key | 🔴 | | | | send-device-key | 🔴 | | |
| send-notification-confirmation | 🔴 | | | | send-notification-confirmation | 🔴 | | |
| send-notification-preferences | 🔴 | | | | send-notification-preferences | 🔴 | | |
| send-to-vehicle | 🔴 | | | | send-to-vehicle | 🔴 | | |
| sentry-mode | | | 🔴 | | sentry-mode | | | 🔴 |
| service-data | 🔴 | 🔴 | | | service-data | 🔴 | 🔴 | |
| session-info | | | 🔴 | | session-info | | | 🔴 |
| set-bioweapon-mode | 🔴 | 🔴 | | | set-bioweapon-mode | 🔴 | 🔴 | |
| set-cabin-overheat-protection | 🔴 | 🔴 | | | set-cabin-overheat-protection | 🔴 | 🔴 | |
| set-charge-limit | ✅ | 🔴 | 🔴 | | set-charge-limit | ✅ | 🔴 | 🔴 |
| set-charging-amps | ✅ | 🔴 | | | set-charging-amps | ✅ | 🔴 | |
| set-climate-keeper-mode | 🔴 | 🔴 | | | set-climate-keeper-mode | 🔴 | 🔴 | |
| set-cop-temp | 🔴 | 🔴 | | | set-cop-temp | 🔴 | 🔴 | |
| set-managed-charge-current-request | | 🔴 | | | set-managed-charge-current-request | | 🔴 | |
| set-managed-charger-location | | 🔴 | | | set-managed-charger-location | | 🔴 | |
| set-managed-scheduled-charging-time | | 🔴 | | | set-managed-scheduled-charging-time | | 🔴 | |
| set-pin-to-drive | | 🔴 | | | set-pin-to-drive | | 🔴 | |
| set-preconditioning-max | 🔴 | 🔴 | | | set-preconditioning-max | 🔴 | 🔴 | |
| set-scheduled-charging | ✅ | 🔴 | | | set-scheduled-charging | ✅ | 🔴 | |
| set-scheduled-departure | ✅ | 🔴 | | | set-scheduled-departure | ✅ | 🔴 | |
| set-sentry-mode | 🔴 | 🔴 | | | set-sentry-mode | 🔴 | 🔴 | |
| set-temps | ✅ | 🔴 | | | set-temps | ✅ | 🔴 | |
| set-valet-mode | 🔴 | 🔴 | | | set-valet-mode | 🔴 | 🔴 | |
| set-vehicle-name | | 🔴 | | | set-vehicle-name | | 🔴 | |
| share-invites | 🔴 | 🔴 | | | share-invites | 🔴 | 🔴 | |
| share-invites-create | 🔴 | 🔴 | | | share-invites-create | 🔴 | 🔴 | |
| share-invites-revoke | | 🔴 | | | share-invites-revoke | | 🔴 | |
| site-address | 🔴 | | | | site-address | 🔴 | | |
| site-config | 🔴 | | | | site-config | 🔴 | | |
| site-data | 🔴 | | | | site-data | 🔴 | | |
| site-name | 🔴 | | | | site-name | 🔴 | | |
| site-tariff | 🔴 | | | | site-tariff | 🔴 | | |
| software-update-start | | | 🔴 | | software-update-start | | | 🔴 |
| solar-savings-forecast | 🔴 | | | | solar-savings-forecast | 🔴 | | |
| speed-limit-activate | 🔴 | 🔴 | | | speed-limit-activate | 🔴 | 🔴 | |
| speed-limit-clear-pin | 🔴 | 🔴 | | | speed-limit-clear-pin | 🔴 | 🔴 | |
| speed-limit-deactivate | 🔴 | 🔴 | | | speed-limit-deactivate | 🔴 | 🔴 | |
| speed-limit-set-limit | 🔴 | 🔴 | | | speed-limit-set-limit | 🔴 | 🔴 | |
| splunk-telemetry | 🔴 | | | | splunk-telemetry | 🔴 | | |
| static-charger-file | 🔴 | | | | static-charger-file | 🔴 | | |
| static-supercharger-file | 🔴 | | | | static-supercharger-file | 🔴 | | |
| status | 🔴 | | | | status | 🔴 | | |
| steering-wheel-heater | | | 🔴 | | steering-wheel-heater | | | 🔴 |
| storm-mode-settings | 🔴 | | | | storm-mode-settings | 🔴 | | |
| sun-roof-control | 🔴 | 🔴 | | | sun-roof-control | 🔴 | 🔴 | |
| take-drivenote | 🔴 | 🔴 | | | take-drivenote | 🔴 | 🔴 | |
| time-of-use-settings | 🔴 | | | | time-of-use-settings | 🔴 | | |
| trigger-homelink | 🔴 | 🔴 | | | trigger-homelink | 🔴 | 🔴 | |
| trigger-vehicle-screenshot | 🔴 | | | | trigger-vehicle-screenshot | 🔴 | | |
| trunk-close | | | 🔴 | | trunk-close | | | 🔴 |
| trunk-move | | | 🔴 | | trunk-move | | | 🔴 |
| trunk-open | | | 🔴 | | trunk-open | | | 🔴 |
| unlock | | | 🔴 | | unlock | | | 🔴 |
| update-calendar-entries | | 🔴 | | | update-calendar-entries | | 🔴 | |
| update-charge-on-solar-feature | 🔴 | | | | update-charge-on-solar-feature | 🔴 | | |
| user-account-upload-profile-picture | 🔴 | | | | user-account-upload-profile-picture | 🔴 | | |
| user-reset-vault | 🔴 | | | | user-reset-vault | 🔴 | | |
| vehicle | | 🔴 | | | vehicle | | 🔴 | |
| vehicle-charge-history | 🔴 | | | | vehicle-charge-history | 🔴 | | |
| vehicle-data | ✅ | 🔴 | | | vehicle-data | ✅ | 🔴 | |
| vehicle-download-vault | 🔴 | | | | vehicle-download-vault | 🔴 | | |
| vehicle-energy-sites | 🔴 | | | | vehicle-energy-sites | 🔴 | | |
| vehicle-subscriptions | | 🔴 | | | vehicle-subscriptions | | 🔴 | |
| vehicle-subscriptions-set | | 🔴 | | | vehicle-subscriptions-set | | 🔴 | |
| vehicle-summary | 🔴 | | | | vehicle-summary | 🔴 | | |
| vehicle-upload-vault | 🔴 | | | | vehicle-upload-vault | 🔴 | | |
| vehicles | ✅ | 🔴 | | | vehicles | ✅ | 🔴 | |
| wake-up | ✅ | 🔴 | 🔴 | | wake-up | ✅ | 🔴 | 🔴 |
| warranty-details | | 🔴 | | | warranty-details | | 🔴 | |
| window-control | 🔴 | 🔴 | | | window-control | 🔴 | 🔴 | |
<!-- tesla_api_coverage end table --> <!-- tesla_api_coverage end table -->

View file

@ -13,17 +13,23 @@
Teslatte is both a CLI and a Rust crate for interacting with the Tesla API. Teslatte is both a CLI and a Rust crate for interacting with the Tesla API.
A Tesla API using the `owner-api.teslamotors.com` endpoint as well as parts of the OAuth flow. It is fairly trivial to add in new endpoints if you feel like creating a PR, but please:
* Write some unit tests if it relies on new or changed data structures.
* Let me know if your PR is a massive change before spending a lot of time on it.
Currently, it only supports some the API. ## APIs implemented
It is fairly trivial to add in new endpoints if you feel like creating a PR. Please let me know if your PR is a massive change before spending a lot of time on it. Only the Owner API is partially supported by this crate, with plans to support the Fleet API and the Command Mode SDK.
[`API.md`](API.md) contains a table of all known Tesla APIs (official and unofficial) and if Teslatte supports it, and where the API details were scraped from.
## References ## References
Thanks to https://tesla-api.timdorr.com/ for their excellent reference. Thanks to https://tesla-api.timdorr.com/ for their excellent reference.
Tesla API recently released [API documentation for their "Fleet API"](https://developer.tesla.com/docs/fleet-api) which appears to be similar to the Tesla Owner API. Tesla recently released [API documentation for their "Fleet API"](https://developer.tesla.com/docs/fleet-api) which appears to be similar to the Tesla Owner API.
Tesla also recently released a [Command Mode SDK](https://github.com/teslamotors/vehicle-command/) which also includes a proxy for the Fleet API.
## CLI ## CLI

View file

@ -1,7 +1,3 @@
use crate::fleet::FleetEndpoint;
use crate::teslatte::TeslatteEndpoint;
use crate::timdorr::TimdorrEndpoint;
use crate::vehicle_command::VehicleCommandEndpoint;
use crate::Endpoint; use crate::Endpoint;
use std::collections::HashMap; use std::collections::HashMap;
use std::fs::File; use std::fs::File;
@ -29,7 +25,7 @@ pub fn generate(merged: &HashMap<String, Endpoint>) -> anyhow::Result<()> {
let after = parts.next().unwrap(); let after = parts.next().unwrap();
let mut table = vec![]; let mut table = vec![];
table.push("| API | Owners API (timdorr) | Fleet API | Command Mode |".to_string()); table.push("| API | Owners API | Fleet API | Command Mode |".to_string());
table.push("| --- | --- | --- | --- |".to_string()); table.push("| --- | --- | --- | --- |".to_string());
// Sort by URL for into a Vec for now. Keep the key. // Sort by URL for into a Vec for now. Keep the key.
@ -45,19 +41,19 @@ pub fn generate(merged: &HashMap<String, Endpoint>) -> anyhow::Result<()> {
} else if endpoint.timdorr.is_some() { } else if endpoint.timdorr.is_some() {
row.push("🔴".to_string()); row.push("🔴".to_string());
} else { } else {
row.push("".to_string()); row.push("".to_string());
} }
if endpoint.fleet.is_some() { if endpoint.fleet.is_some() {
row.push("🔴".to_string()); row.push("🔴".to_string());
} else { } else {
row.push("".to_string()); row.push("".to_string());
} }
if endpoint.vehicle_command.is_some() { if endpoint.vehicle_command.is_some() {
row.push("🔴".to_string()); row.push("🔴".to_string());
} else { } else {
row.push("".to_string()); row.push("".to_string());
} }
table.push(format!("| {} |", row.join(" | "))); table.push(format!("| {} |", row.join(" | ")));
@ -66,7 +62,7 @@ pub fn generate(merged: &HashMap<String, Endpoint>) -> anyhow::Result<()> {
let table = table.join("\n"); let table = table.join("\n");
// Now join them together and write the whole file back. // Now join them together and write the whole file back.
let contents = format!("{before}\n{START}\n{table}\n{END}\n{after}"); let contents = format!("{before}{START}\n{table}\n{END}{after}");
let mut file = File::create(&path)?; let mut file = File::create(&path)?;
file.write_all(contents.as_bytes())?; file.write_all(contents.as_bytes())?;