<?php

namespace ControlScripts\Scopes;

use \SHServ\Middleware\ControlScripts;
use \SHServ\Implements\ControlScriptsInterface;

class HallScope extends ControlScripts implements ControlScriptsInterface {
	use \ControlScripts\Common;

	public function register_sync_map(): void {
		$this -> register_global_device_sync_map();
	}

	public function register_events_handlers(): void {
		$this -> auto_button_bindings([
			"first_hall_buttons1" => [],
			"first_hall_buttons2" => [],
			"hall_secondary" => [],
			"btns_hall2_1" => [],
		]);
	}

	public function register_actions_scripts(): void {
		$this -> add_group_toggle_action("hall2_toggle", "Холл 2", [
			"light_hub_1:2",
		], [
			"description" => "Вкл/Выкл. свет в холле 2",
			"author" => "Eugene Sukhodolskiy",
		]);

		$this -> add_hatch_action("hatch_open", "Открыть люк", "hatch_motor", "open", 100, [
			"icon" => '<i class="ph ph-arrow-fat-line-up"></i>',
			"description" => "Открыть люк в мансарду",
			"author" => "Eugene Sukhodolskiy",
			"danger_level" => "cautious",
		]);

		$this -> add_hatch_action("hatch_close", "Закрыть люк", "hatch_motor", "close", 100, [
			"icon" => '<i class="ph ph-arrow-fat-line-down"></i>',
			"description" => "Закрыть люк в мансарду",
			"author" => "Eugene Sukhodolskiy",
			"danger_level" => "cautious",
		]);
	}

	public function register_regular_scripts(): void {}
}
