diff --git a/server/ControlScripts/Common.php b/server/ControlScripts/Common.php index 35bcba7..4d405fe 100644 --- a/server/ControlScripts/Common.php +++ b/server/ControlScripts/Common.php @@ -10,6 +10,7 @@ ["type" => "relay", "alias" => "spotlight_main_back_1", "channel" => 0], ["type" => "button", "alias" => "buttons_backdoor", "channel" => 0], ["type" => "button", "alias" => "master_door_btns", "channel" => 0], + ["type" => "button", "alias" => "bed_btns_left", "channel" => 0], ]); $this -> add_sync_connection([ @@ -52,7 +53,37 @@ ["type" => "relay", "alias" => "light_hub_1", "channel" => 1], ["type" => "button", "alias" => "master_room_btns", "channel" => 0], ["type" => "button", "alias" => "bed_btns_right_1", "channel" => 1], + ["type" => "button", "alias" => "bed_btns_left", "channel" => 1], ]); + + $this -> add_sync_connection([ + ["type" => "relay", "alias" => "bathroom_2_light", "channel" => 0], + ["type" => "button", "alias" => "hall_secondary", "channel" => 1], + ]); + + // 14 - down, 12 - left, 13 - top, 15 - right + // 3 - top + // 14->1 12->3 13->0 + $this -> add_sync_connection([ + ["type" => "relay", "alias" => "plants_room_light", "channel" => 0], + ["type" => "button", "alias" => "plants_room_btns", "channel" => 3], + ]); + + $this -> add_sync_connection([ + ["type" => "relay", "alias" => "italy_lamp_relay", "channel" => 0], + ["type" => "button", "alias" => "plants_room_btns", "channel" => 2], + ]); + + $this -> add_sync_connection([ + ["type" => "relay", "alias" => "floor_lamp_relay", "channel" => 0], + ["type" => "button", "alias" => "plants_room_btns", "channel" => 0], + ]); + + $this -> add_sync_connection([ + ["type" => "relay", "alias" => "server_room_light", "channel" => 0], + ["type" => "button", "alias" => "btns_hall2_1", "channel" => 1], + ]); + } public function btn_on_online(String $alias, Array $muted = []): void { diff --git a/server/ControlScripts/Scopes/LightHubScope.php b/server/ControlScripts/Scopes/LightHubScope.php index 245289a..ae1848d 100644 --- a/server/ControlScripts/Scopes/LightHubScope.php +++ b/server/ControlScripts/Scopes/LightHubScope.php @@ -14,13 +14,20 @@ public function register_events_handlers(): void { $this -> btn_on_online("master_room_btns", [2, 3]); - $this -> btn_on_online("btns_hall2_1", [1]); - $this -> btn_on_online("hall_secondary", [1]); - $this -> btn_on_online("bed_btns_right_1", []); + $this -> btn_on_online("btns_hall2_1"); + $this -> btn_on_online("hall_secondary"); + $this -> btn_on_online("bed_btns_right_1"); + $this -> btn_on_online("bed_btns_left"); $this -> set_btns_click_handlers("master_room_btns"); $this -> set_btns_click_handlers("btns_hall2_1"); $this -> set_btns_click_handlers("hall_secondary"); $this -> set_btns_click_handlers("bed_btns_right_1"); + $this -> set_btns_click_handlers("bed_btns_left"); + + + $this -> btn_on_online("plants_room_btns", [1]); + $this -> set_btns_click_handlers("plants_room_btns"); + } public function register_actions_scripts(): void { diff --git a/server/SHServ/config.php b/server/SHServ/config.php index 1b332d4..cdf4627 100644 --- a/server/SHServ/config.php +++ b/server/SHServ/config.php @@ -8,10 +8,10 @@ "db" => [ "dblib" => "mysql", "host" => "localhost", - "dbname" => "smart-home-server", + "dbname" => "shome", "charset" => "utf8", - "user" => "eugene", - "password" => "root" + "user" => "u_shome", + "password" => "halloween" ], "app_file" => "App.php", "templates_folder" => "Templates", diff --git a/webclient/config.php b/webclient/config.php index 8aa1c40..0cc6324 100644 --- a/webclient/config.php +++ b/webclient/config.php @@ -2,7 +2,7 @@ return [ "version" => "0.2 dev", - "server" => "http://192.168.1.31", + "server" => "http://192.168.1.101", // Какие пути разрешены (белый список) — подстрой под себя "allowed_prefixes" => [ "/api/v1/", @@ -15,4 +15,4 @@ // 'https://your-frontend-domain.com', ], ], -]; \ No newline at end of file +];