<?php

namespace ControlScripts\Scopes;

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

class OfficeScope 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([
			"buttons_office_room" => [],
		]);
	}

	public function register_actions_scripts(): void {
		$this -> add_toggle_action("computer_table_lamp_switch", "Комп. лампа", "computer_table_lamp", 0, [
			"icon" => '<i class="ph ph-lamp"></i><i class="ph ph-desktop"></i>',
			"description" => "Вкл/Выкл. настольную компьютерную лампу",
			"author" => "Eugene Sukhodolskiy",
			"state_callback" => function() {
				return $this -> helper() -> make_relay_indicator("computer_table_lamp", 0);
			},
		]);

		$this -> add_toggle_action("craft_table_lamp_switch", "Мастерская лампа", "craft_table_lamp", 0, [
			"icon" => '<i class="ph ph-lamp"></i>',
			"description" => "Вкл/Выкл. лампу в мастерской",
			"author" => "Eugene Sukhodolskiy",
			"state_callback" => function() {
				return $this -> helper() -> make_relay_indicator("craft_table_lamp", 0);
			},
		]);
	}

	public function register_regular_scripts(): void {}
}
