diff --git a/server/ControlScripts/SpotlightsScope.php b/server/ControlScripts/SpotlightsScope.php new file mode 100644 index 0000000..ffcca50 --- /dev/null +++ b/server/ControlScripts/SpotlightsScope.php @@ -0,0 +1,69 @@ + stand_btn_pressed_to_stand_relay(); + } + + public function register_actions_scripts(): void { + $this -> add_action_script([ + "alias" => "spotlights_on", + "name" => "All Spotlights On", + "description" => "Включить все прожекторы", + "author" => "Eugene Sukhodolskiy" + ], function($params) { + $aliases = [ + "spotlight_main_back_1", + "spotlight_main_back_2", + "spotlight_main_front_1" + ]; + + $results = []; + + foreach($aliases as $alias) { + $results[$alias] = $this -> devices() -> by_alias($alias) -> device_api() -> set_state(true); + } + + return [ + "devices" => $results + ]; + }); + + $this -> add_action_script([ + "alias" => "spotlights_off", + "name" => "All Spotlights Off", + "description" => "Выключить все прожекторы", + "author" => "Eugene Sukhodolskiy" + ], function($params) { + $aliases = [ + "spotlight_main_back_1", + "spotlight_main_back_2", + "spotlight_main_front_1" + ]; + + $results = []; + + foreach($aliases as $alias) { + $results[$alias] = $this -> devices() -> by_alias($alias) -> device_api() -> set_state(false); + } + + return [ + "devices" => $results + ]; + }); + } + + public function register_regular_scripts(): void { + + } + + // EVENTS HANDLERS + + protected function stand_btn_pressed_to_stand_relay() { + + } +} \ No newline at end of file