{"id":16242680,"url":"https://github.com/brianmay/fake_luxary_api","last_synced_at":"2025-04-08T10:41:18.865Z","repository":{"id":207267369,"uuid":"718534632","full_name":"brianmay/fake_luxary_api","owner":"brianmay","description":"Fake API for testing","archived":false,"fork":false,"pushed_at":"2024-10-15T05:14:24.000Z","size":302,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T06:55:44.042Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianmay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-14T09:31:26.000Z","updated_at":"2024-10-15T05:14:28.000Z","dependencies_parsed_at":"2023-11-29T05:28:37.889Z","dependency_job_id":null,"html_url":"https://github.com/brianmay/fake_luxary_api","commit_stats":null,"previous_names":["brianmay/fake_luxary_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmay%2Ffake_luxary_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmay%2Ffake_luxary_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmay%2Ffake_luxary_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianmay%2Ffake_luxary_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianmay","download_url":"https://codeload.github.com/brianmay/fake_luxary_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247827870,"owners_count":21002965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T14:12:10.947Z","updated_at":"2025-04-08T10:41:18.847Z","avatar_url":"https://github.com/brianmay.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fake Luxury API\n\nTesla API client and simulator.\n\nUses older REST based API. Future of this API uncertain.\n\nShould, be considered alpha quality, as desired functionality not\nimplemented yet and future refactoring may change APIs.\n\n## Usage\n\nRun the simulator server:\n\n```sh\ncargo-watch watch -x 'run --bin fla_server'\n```\n\nRun the tests (requires server be running):\n\n```sh\ncargo test\n```\n\nNote: Running tests will change the test mode on the server. Tests should not be run against Tesla servers.\n\nGet data from the simulator (not streaming test uses `vehicle_id` not `id`):\n\n```sh\ncargo run --bin get_vehicles\ncargo run --bin get_data 123456789\ncargo run --bin streaming_test 999456789\n```\n\nChange the simulator mode (do not use this command on real Tesla server):\n\n```sh\ncargo run --bin simulate 123456789 driving\ncargo run --bin simulate 123456789 charging\ncargo run --bin simulate 123456789 idle\n```\n\nGet data from real Tesla server:\n\n* Requires token, see [tesla_auth](https://github.com/adriankumpf/tesla_auth) for one way to get the token.\n* This method uses [pass](https://www.passwordstore.org/) for keeping secrets, but should be easy to adopt to other methods.\n* Don't get confused between `id` (for json requests) and `vehicle_id` (required for streaming).\n\n```sh\npass insert tesla/access_token\npass insert tesla/refresh_token\n./wrapper cargo run --bin get_vehicles\n./wrapper cargo run --bin get_data \u003cid\u003e\n./wrapper cargo run --bin streaming_test \u003cvehicle_id\u003e\n```\n\n## Type Errors\n\nThe above commands might fail due to type errors. Because there doesn't appear to be anywhere I can find an official list of types. A type error looks like:\n\n```sh\n$\nthread 'main' panicked at /home/brian/tree/personal/fake_luxury_api/fla_client/src/lib.rs:353:17:\nError deserializing vehicle: response.charge_state.charger_phases: invalid type: integer `1`, expected a string at line 1 column 984\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n```\n\nIn this case the problem is that charging_state has declared to require a String value, but we got an integer from Tesla instead.\n\nThis was the [fix](https://github.com/brianmay/fake_luxary_api/commit/7e269c764fd57d98bf6cd48a01754a3f277aca21) was simple.\n\n```diff\nFrom 7e269c764fd57d98bf6cd48a01754a3f277aca21 Mon Sep 17 00:00:00 2001\nFrom: Brian May \u003cbrian@linuxpenguins.xyz\u003e\nDate: Thu, 23 Nov 2023 12:55:15 +1100\nSubject: [PATCH] Fix type of charger_phases\n\n---\n fla_common/src/types.rs | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/fla_common/src/types.rs b/fla_common/src/types.rs\nindex f9544dc..a59ef3c 100644\n--- a/fla_common/src/types.rs\n+++ b/fla_common/src/types.rs\n@@ -229,7 +229,7 @@ pub struct ChargeState {\n     pub charge_port_latch: String,\n     pub charge_rate: Option\u003cf32\u003e,\n     pub charger_actual_current: i64,\n-    pub charger_phases: Option\u003cString\u003e,\n+    pub charger_phases: Option\u003cu8\u003e,\n     pub charger_pilot_current: i64,\n     pub charger_power: i64,\n     pub charger_voltage: i64,\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianmay%2Ffake_luxary_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianmay%2Ffake_luxary_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianmay%2Ffake_luxary_api/lists"}