File tree Expand file tree Collapse file tree 6 files changed +29
-2
lines changed
Expand file tree Collapse file tree 6 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 1515 <string id =" menu_label_reset" >Remise à zéro</string >
1616 <string id =" menu_label_honk" >Klaxon</string >
1717 <string id =" menu_label_toggle" >Temp. °C/°F</string >
18+ <string id =" menu_label_flash_lights" >Flash Lights</string >
19+
1820<!-- Template: <string id="menu_label_%snake_case%">%Title Case%</string>-->
1921
2022 <!-- Second view -->
3739 <string id =" label_unlock_doors" >Déver. portes</string >
3840 <string id =" label_unlocked" >Ouverte</string >
3941 <string id =" label_waking_vehicle" >Réveil du vehicule...</string >
42+ <string id =" label_flash_lights" >Flash Lights</string >
43+
4044<!-- Template: <string id="label_%snake_case%">%Title Case%</string> -->
4145
4246</strings >
Original file line number Diff line number Diff line change 44 <menu-item id =" toggle_units" label =" @Strings.menu_label_toggle" />
55 <menu-item id =" select_car" label =" @Strings.menu_label_select_car" />
66 <!-- Template: <menu-item id="%snake_case%" label="@Strings.menu_label_%snake_case%" /> -->
7+ <menu-item id =" flash_lights" label =" @Strings.menu_label_flash_lights" />
78
89</menu >
Original file line number Diff line number Diff line change 1919 <string id =" menu_label_honk" >Honk</string >
2020 <string id =" menu_label_toggle" >Toggle C vs. F</string >
2121 <string id =" menu_label_select_car" >Select Vehicle...</string >
22+ <string id =" menu_label_flash_lights" >Flash Lights</string >
23+
2224 <!-- Template: <string id="menu_label_%snake_case%">%Title Case%</string> -->
2325
2426 <string id =" setting_token_label" >API Token</string >
4446 <string id =" label_unlock_doors" >Unlock Doors</string >
4547 <string id =" label_unlocked" >Unlocked</string >
4648 <string id =" label_waking_vehicle" >Waking vehicle...</string >
49+ <string id =" label_flash_lights" >Flash Lights</string >
50+
4751 <!-- Template: <string id="label_%snake_case%">%Title Case%</string> -->
4852
4953</strings >
Original file line number Diff line number Diff line change @@ -27,9 +27,13 @@ class OptionMenuDelegate extends Ui.MenuInputDelegate {
2727 } else {
2828 Application .getApp ().setProperty (" imperial" , true );
2929 }
30+ } else if (item == :flash_lights ) {
31+ _controller ._flash_lights = true ;
32+ _controller .stateMachine ();
33+
3034 /* Template:
31- } else if (item == :" %snake_case%) {
32- _controller._" %snake_case% = true;
35+ } else if (item == :%snake_case%) {
36+ _controller._%snake_case% = true;
3337 _controller.stateMachine();
3438 */
3539 }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class SecondDelegate extends Ui.BehaviorDelegate {
2626 var _lock;
2727 var _settings;
2828 // Template: // var _%lower_case% dnl
29+ var _flash_lights;
2930
3031 var _data;
3132
@@ -60,6 +61,7 @@ class SecondDelegate extends Ui.BehaviorDelegate {
6061 _unlock = false ;
6162 _lock = false ;
6263 // Template: // _%snake_case% = false
64+ _flash_lights = false ;
6365
6466
6567 if (_dummy_mode ) {
@@ -168,6 +170,12 @@ class SecondDelegate extends Ui.BehaviorDelegate {
168170 _tesla.%camelCase%(_vehicle_id, method(:genericHandler));
169171 } */
170172
173+ if (_flash_lights ) {
174+ _flash_lights = false ;
175+ _handler .invoke (Ui .loadResource (Rez .Strings .label_flash_lights ));
176+ _tesla .% camelCase % (_vehicle_id , method (:genericHandler ));
177+ }
178+
171179 if (_unlock ) {
172180 _unlock = false ;
173181 _handler .invoke (Ui .loadResource (Rez .Strings .label_unlock_doors ));
Original file line number Diff line number Diff line change @@ -123,6 +123,12 @@ class Tesla {
123123 // _notify.invoke(responseCode, data);
124124 // }
125125
126+ function flashLights (vehicle , notify ) {
127+ var url = " https://owner-api.teslamotors.com/api/1/vehicles/" + vehicle .toString () + " /command/flash_lights" ;
128+ System .println (url );
129+ genericPost (url , notify );
130+ }
131+
126132 /* Template:
127133 function %camelCase%(vehicle, notify) {
128134 var url = "https://owner-api.teslamotors.com/api/1/vehicles/" + vehicle.toString() + "/command/%snake_case%";
You can’t perform that action at this time.
0 commit comments