<?php

namespace ControlScripts\Scopes;

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

class KitchenScope 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([
			"kitchen_buttons_11" => [],
			"kitchen_buttons_2" => [],
		]);
	}

	public function register_actions_scripts(): void {
		$this -> add_group_toggle_action("kitchen1_toggle", "Кухня 1", [
			"fisrt_floor_big_relay:0",
		], [
			"description" => "Вкл/Выкл. свет на кухне 1",
			"author" => "Eugene Sukhodolskiy",
			"state_callback" => function() {
				return $this -> helper() -> make_relay_indicator("fisrt_floor_big_relay", 0);
			},
		]);

		$this -> add_group_toggle_action("kitchen2_toggle", "Кухня 2", [
			"fisrt_floor_big_relay:1",
		], [
			"description" => "Вкл/Выкл. свет на кухне 2",
			"author" => "Eugene Sukhodolskiy",
			"state_callback" => function() {
				return $this -> helper() -> make_relay_indicator("fisrt_floor_big_relay", 1);
			},
		]);
	}

	public function register_regular_scripts(): void {}
}
