diff --git a/automation/Scopes/HallScope.php b/automation/Scopes/HallScope.php index 7500ab3..62c16cc 100644 --- a/automation/Scopes/HallScope.php +++ b/automation/Scopes/HallScope.php @@ -22,19 +22,11 @@ } public function register_actions_scripts(): void { - $this -> add_group_toggle_action("hall1_toggle", "Холл 1", [ - "light_hub_1:3", - ]); - $this -> add_group_toggle_action("hall2_toggle", "Холл 2", [ "light_hub_1:2", - ]); - - $this -> add_group_toggle_action("all_hub_toggle", "Весь хаб", [ - "light_hub_1:0", - "light_hub_1:1", - "light_hub_1:2", - "light_hub_1:3", + ], [ + "description" => "Вкл/Выкл. свет в холле 2", + "author" => "Eugene Sukhodolskiy", ]); $this -> add_hatch_action("hatch_open", "Открыть люк", "hatch_motor", "open", 100, [ diff --git a/automation/Scopes/KitchenScope.php b/automation/Scopes/KitchenScope.php index cbcbc72..da32169 100644 --- a/automation/Scopes/KitchenScope.php +++ b/automation/Scopes/KitchenScope.php @@ -22,14 +22,17 @@ public function register_actions_scripts(): void { $this -> add_group_toggle_action("kitchen1_toggle", "Кухня 1", [ "fisrt_floor_big_relay:0", + ], [ + "description" => "Вкл/Выкл. свет на кухне 1", + "author" => "Eugene Sukhodolskiy", ]); $this -> add_group_toggle_action("kitchen2_toggle", "Кухня 2", [ "fisrt_floor_big_relay:1", + ], [ + "description" => "Вкл/Выкл. свет на кухне 2", + "author" => "Eugene Sukhodolskiy", ]); - - $this -> add_on_action("kitchen1_on", "Кухня 1 вкл", "fisrt_floor_big_relay", 0); - $this -> add_on_action("kitchen2_on", "Кухня 2 вкл", "fisrt_floor_big_relay", 1); } public function register_regular_scripts(): void {} diff --git a/automation/Scopes/MasterBedroomScope.php b/automation/Scopes/MasterBedroomScope.php index dc9177a..1015eba 100644 --- a/automation/Scopes/MasterBedroomScope.php +++ b/automation/Scopes/MasterBedroomScope.php @@ -23,6 +23,9 @@ public function register_actions_scripts(): void { $this -> add_group_toggle_action("master_toggle", "Спальня", [ "light_hub_1:1", + ], [ + "description" => "Вкл/Выкл. свет в спальне", + "author" => "Eugene Sukhodolskiy", ]); } diff --git a/automation/Scopes/OutdoorScope.php b/automation/Scopes/OutdoorScope.php index 45c2e53..48b23b6 100644 --- a/automation/Scopes/OutdoorScope.php +++ b/automation/Scopes/OutdoorScope.php @@ -20,19 +20,35 @@ } public function register_actions_scripts(): void { - $this -> add_group_toggle_action("all_spotlights_toggle", "Все прожекторы", [ - "spotlight_main_back_1", - "spotlight_main_back_2", - "spotlight_main_front_1", + $this -> add_action_script([ + "alias" => "all_spotlights_off", + "name" => "Все прожекторы выкл", + "description" => "Выключить все прожекторы", + "author" => "Eugene Sukhodolskiy", + ], function($params) { + return $this -> group_set_state([ + "spotlight_main_back_1", + "spotlight_main_back_2", + "spotlight_main_front_1", + ], false); + }); + + $this -> add_off_action("front_spotlight_off", "Передний прожектор выкл", "spotlight_main_front_1", null, [ + "description" => "Выключить передний прожектор", + "author" => "Eugene Sukhodolskiy", ]); - $this -> add_on_action("front_spotlight_on", "Передний прожектор вкл", "spotlight_main_front_1"); - $this -> add_off_action("front_spotlight_off", "Передний прожектор выкл", "spotlight_main_front_1"); - - $this -> add_group_toggle_action("back_spotlights_on", "Задние прожекторы вкл", [ - "spotlight_main_back_1", - "spotlight_main_back_2", - ]); + $this -> add_action_script([ + "alias" => "back_spotlights_off", + "name" => "Задние прожекторы выкл", + "description" => "Выключить задние прожекторы", + "author" => "Eugene Sukhodolskiy", + ], function($params) { + return $this -> group_set_state([ + "spotlight_main_back_1", + "spotlight_main_back_2", + ], false); + }); } public function register_regular_scripts(): void {}