<?php

namespace ControlScripts\Scopes;

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

class PlantsRoomScope 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([
			"plants_room_btns" => ["mute" => [1]],
		]);
	}

	public function register_actions_scripts(): void {
		$this -> add_toggle_action("plants_room_light_switch", "Свет в комнате растений", "plants_room_light", 0, [
			"description" => "Вкл/Выкл. свет в комнате растений",
			"author" => "Eugene Sukhodolskiy",
			"state_callback" => function() {
				return $this -> helper() -> make_relay_indicator("plants_room_light", 0);
			},
		]);

		$this -> add_toggle_action("italy_lamp_switch", "Italy лампа", "italy_lamp_relay", 0, [
			"description" => "Вкл/Выкл. Italy лампу",
			"author" => "Eugene Sukhodolskiy",
			"state_callback" => function() {
				return $this -> helper() -> make_relay_indicator("italy_lamp_relay", 0);
			},
		]);

		$this -> add_toggle_action("floor_lamp_switch", "Торшер", "floor_lamp_relay", 0, [
			"description" => "Вкл/Выкл. торшер",
			"author" => "Eugene Sukhodolskiy",
			"state_callback" => function() {
				return $this -> helper() -> make_relay_indicator("floor_lamp_relay", 0);
			},
		]);
	}

	public function register_regular_scripts(): void {}
}
