Свойства класса:
Методы класса:
if ($this->getProperty("power")) { // Восстанавливаем сохранённые параметры кондиционера $this->setProperty("turbo", $this->getProperty("turbo_old")); $this->setProperty("ion", $this->getProperty("ion_old")); // Включаем кондиционер getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000043b000037276a0090f6670acc0d43b403000000b5d000005e47802032e0c95f43ffe1d2ab07a4176e8910eb7963c57dbdafb9e978c7380d254f31cbaa93226d6bbd1fb636e2ab000ed35d6671df7fa1b059ac9c86d2f10b5ab0bcbd1e55bd2f17b57c8778512c6fc40e5a525fd9f4c341134a61bff9476d1ffe809d9a418bc28d6a86d8044ee5f9701e80cf14db98a31625fb3ab44aa1e26e39a47ea7c085914d120cee4ac1533543680760e59f1714529da9b577461a2bd41fa95ff0fe868d543eda7c3d8a1cf4d1714eead90c71bf149c75841b59daa74fe033736efa9fc4d9ee7d93d3e6ffcd7905bf821bb3b18d35d5cdcb51ef89e2"); // Устанавливаем режим работы $this->callMethod('SetParams'); } else { $this->setProperty("turbo", 0); $this->setProperty("ion", 0); // Выключаем кондиционер getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000ee32000037276a00fad1670acc0d43b40300000077d0000038cd9cf64b6d9b2e4cbb2a510eb827bf1957c0e946d543c27789719665028bd53bc66a7bcfd0aa7707674ab60570c4fa7029bda780004c2793001abaa469be44266616b4045fe6a514e26b246e13481b45135699ff655350dc72e18a40168326b5a7c0b5722cf66e8701809e2003db97989b221ac64c3519f69b57fac7489dbbbc9e514c8731e968a3fec5d7bea06bb3fe5cf9425b40f50b11011ed78f6bb0d889ddb33b258b9bfad766792bbe19eb93e3308a7f247898915d7de0303c922430109265355abfe5103452737e507c865d488d5e987e981de4777901db988815d1"); }
// Ограничиваем параметр температуры допустимым диапазоном if ($this->getProperty("temp") < 18) $this->setProperty("temp", 18); if ($this->getProperty("temp") > 32) $this->setProperty("temp", 32); if ($this->getProperty("ion")) // Ионизация включена { if ($this->getProperty("turbo")) { // Включаем режим Турбо getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000f13c000037276a000289670acc0d43b403000000b4d000004511850f3cb53a97a9cc269f29b17e6a9ac765b2558f68b9fc6c7bd23d94764af871a15042bf5ebd19fd298c2d08b2f1ef1126eab132a0b9cdf989f23e4bb5da90917997bca9b198dcf852aeb557aaf65d036831f5e2e6b792b6db3633753ba3bf3e0cc921bbe1cd7eda2959b4320cd7465c8af01751e21f2d3088937b56a72d44afdafb8b1b75685b307048b505e8f1b4be9d776cc5d8e76ff933bcde95222b836815343513a6919949571155391da40d6f8533c833a6f7feeb296fe03b8dcfdd6ffb4bad1297bca7d22379bddeb2b3815eae97f5f09475f83262f570b90c77"); say("Включен режим турбо, влючена ионизация", 2); } else { // Устанавливаем температуру switch ($this->getProperty("temp")) { case 18: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000d136000037276a00b6d9670acc0d43b403000000b5d000000f132fc8858d6da450d5d9282955d1425e09f2c2cd178358bf4dab131f292ecfbd95aed2cb85002116be4258094d6564864a3d1679b154c9ea0d5ba611994d3f1758249fd3f7d47b855c67a6cf4b0ce5766cc0f80994321363a24249650bfd3f93d1c9b0f11bc5f6f421435fb88af4b84aa09ae0abce2a63179f90ebfb928a0730d7285cbc03a322331213606981377fc2153fce4e97778853f9e4e3a79565c230bdd7663fded4dc0db0d5b127c2705987b605feab6122b919a4692c7c795c48d3c7968ff86aa69f0c9c11d1c8968e2d1af000daac7db97d98d0f682a6b87522"); break; case 19: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000e531000037276a004c9e670acc0d43b403000000f3d0000057e63a9df9ec46db2e0997db4da1e13dd0dd66cf96a5d952209d773e0db509f81e9ad39fb998694733ce4c2222460c4fbff724ea367563af462186bf30a7878c73193df0e71c0bbd0f658330025af3bd11ad0eb47d82f6a797b7543514896868375bbb62b26425b063a56ee233c9dc6dc90f0a0048c8f8472f1a02fe7a7369561626c678786ce049d745883197b025a9dfdece1c7d790806db90d04d0e2648ca173cf09a7010e41765e50665f074f3c0bfd959a728673429e8c19651e52ef43b13b174ffd94c880116098b7b72b57f0e3eb27bab09b1789329e843db14517d3f"); break; case 20: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000aa39000037276a0010bd670acc0d43b403000000f3d00000d59544c8175b43269fc37ce22a34eee27900018a31c7a7edc73e37c0561762a7ae89fcf834cf46c64b176b2e1879bb257c34723162a02aef6c6980ed19c746906ef5ec9257540e8a5a99947ba42e6086f5c373e1da74db6b3bb80b820ebfe7dc88c69951264c6e3cef56d090d0a7ba4681e028668762d9555216023aca8aa56f662514ecd99a47d25649d3b3ba959016e4b4d3c373a7355cc4bdabc7b9d13a7b6d0ca56c027ac21bea085c7c9b457bdec07935daf5df637654303549e19d9e09d27d4ed1dc5b4206378ab2d3183101f780b1c976276f3daebec4e26be8de08c6"); break; case 21: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000bc3b000037276a00a6b6670acc0d43b403000000f1d00000694f342fbe54de54104e57541187cd7266d257e564b0151ef50269aa2ed93702ec1efdd8f60eeda4a078c5f8fc33f7cbfe0357d6b03607abfd633c9808cfd09fd12057680a1bd6ca0825a5971ac18151e3e916c75b6a4e513cf7ad08d5ee6c7cd1e6980ce316eec2854167cb8cd349117b7c543d3f89043809aba3f2beb137f877ff3a396e8aa5a9f463632e3bee11e8fefa0048951548fce503f40cc77dd3c0f253964cbc0992de6cecf5f9c850a69b6d6ca46aa83fcde06e32d79d1a0d4d69ec98ffa1d2a9bd2327361c15fe77b7257bb919411af83e1ab293d1a6f6715c75"); break; case 22: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000cb42000037276a0050f2670acc0d43b403000000f0d0000082d6e0d135e72c156d68375ca4bbc2f8d9bd48ce0961c452bfbd728936511feca54a6ce6864f8da397e663076730c559cb04ff57f8afa238a5feabad5c4f11ff7a942053d1c181493fa8545b0bb4d677fa8078dcaaa3bc2ab913b680ff9228f1dbd3c7929b56cf95074ac3c140b919c328fe03eff7dabb0366d85762d0accd55595e79a0c98e09e69eea24ac5706f66d009b28f0a3b3406468013001ee3351b6ef727686e470eb8f1ee5ebcecabe9cefef0fbc72d8948a57f544f3b2dad78d97e3a08156669deff1f4d4084c7a35537c2107d36f7c5959f5fe6fea18784f8667"); break; case 23: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000a937000037276a009085670acc0d43b40300000030d100003fa072dd2b5d285a63c4c4705c4de3a5a39150209ecdb43cde5ab0d973e4569d19d45e260944aa654df383a255bc319bbd66b3cf501d9074fedb8b867f3c024e51058daa8add73adfc7cf26495495a7aa0b9f6b96026b6b4eb4ce98ff9cc73cb287797ffdc2cabae9cae3d2978dc182d714a75569665242095b01b16b24f73f1cda1957108c493a44f2639226d1763be463508230cb8f6f632a0bc1e811d5f045afdd4a2caaf1d01fc7caaa9a4778eb1f423bf2d523f85f0231f5af7c4509394664fb7f3b09d2ccc7466b761475505af5e8e0db669758d7043534179ff42f5f2"); break; case 24: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000e43b000037276a002c9f670acc0d43b40300000031d100000739ebb0caf048bcd224c3829e03fe9f4453c2ca7bed17dbd8d96d204db4565b655ebac2e6c4dc6d27d90faec1b443412882835f77098ea472b46151bdf222255bf1f972dd0246e7fb5bafd31206f225f2440dcb3f6761ad1024cfc83ec17abeaf96a47bd2767b92d769df008e2444e5cd3e425bb85d7cb18c785dba752b15235248f79de15f20d36b3252985d556dc8229ac044d6bca3de097b8f5ef6ded8539556ec4a394319f57f7af9eb1ee57ea082c69e9b85c01df9b7880a9ce37a047118c35036a336c87df167d08815e45e23658696f7d1e7d570c794347b7c229e1d"); break; case 25: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000033b000037276a00fad8670acc0d43b403000000f3d000000739ebb0caf048bcd224c3829e03fe9fb93cc23aa93ded31d0d979b3c676999c90bb968e094f4f8b8d53ce96edf17142381fae142c32d6b2d239fbd76a9ec6b24bdfb42738ce49d1a4fdb2677cee14be82aa58e0ac355d262e31c520da38114042363af6966e477ce7e29e2c44fa1000bbed9c92b3db588942c999fcef07443a44433a646b85c053502570461f22d6b4371ad04648d3319663a52b406c976039ea7acdf38884c9c322764e863f82512f5a1f37f627874891c27481ca489db353c1b0fed17ddda8c2f9336f67fd3b0711711f375bd4398db24ec7ecfdbdf37704"); break; case 26: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000000937000037276a00f0a9670acc0d43b403000000f1d000007ff539a130eaaf585f498f4ccdf673034c4abf2f2e8cb95b5cd6f2e52ad129036e32647ba907564d6a269c63a3cef4fe05e902d1c71bef38902a85dc493dd5a22982c37b07f9e879fec35f9c043913006b329ce8dd73671df480ea04f865f480646b3884a981a8d1c0a192b2e1afdc4fb47ad60bcb512263af58e0162c7e603d5b428c91dd3f9509c7920500375ef91b0530bca006ba0c07292c8913aaf773e870c471065d8f76b7bc4852a044d1e12cdca2c38f64e925a1951ff62706add40a4b24faa0df87d048eeb7e1b84568d0897ae52b90191d30f3c810472193b62ac7"); break; case 27: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000004b34000037276a00def9670acc0d43b4030000002ed1000082d6e0d135e72c156d68375ca4bbc2f817a1508f35d74f95063fea6f2fa11a93076ad437b9f818a2fcce86f7207aef33737055255b3c21ec810118e62f25774b4fecc6cdae1cfc0e4c3d23128c708fc567f66cde0373460d7ba633aa590963039bbf36ebce57666e9df9eb24513007649b7b4bcd1416a3243ebdb4cb4f2ad01d9f9f9ea1edb7e185bd481dc8aa49443b413da72ca76cbaef4fe6d12d3e37457ed8d25d1a6845d38e7b0a87693bc43afc8d49239eede1ff1a22b6075dc7c59a1d0a9afbdde0fcad2e818a2caa9f5b3be10043c006a79c2b455c4be9f1cacd2576"); break; case 28: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000004431000037276a0062fc670acc0d43b4030000002fd1000047e972fbf25935f85a3d65818433577164ff0d6e4a9f938cd57850196c56a9fec0fe2ed8c04c41b047877531a72d2830e0b166ca6000e3a78f75093d968030b456e8bdef50bc7da1ab301f724ce815353c146be08b5952e64213d728d9d55b656665204bdc859f51af4e32379e897846cd96ab8fa06b251120699fec22b954fa77994e47d0a74454821fa6c1a8ac9f694b6f4f4d4614605e8f2ab41db21a79a1f2f01a13d14fb9b20b09ef4f89596fdc058c6780d03da76c0154ca11f6af012f7ef70b13b9501e31b20c6fadc52effab5723beaceb48a984e78c2a3508875161"); break; case 29: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000ca38000037276a0092f6670acc0d43b40300000031d10000eee8ee4fdf817ec30a2b7cb3045d19c40c83d37fd120578b55cb4017f468369a8242d61a00a20535a69f0a0d4bbc81c84e3d1b4e32bd2d80b37a5090dc7b4fb5d7e64d56d7aff5b7566cd54fda05190328aaccce9f9bbe71d7a35155b4a7b3f27abe97f380037dff0a7ee4383df0b3b8c99c35cb5da429e2489e420fe50e42dd6a901de489ed29a71738c8e925e372c2bf4e29bfc91569854c758cb4089f04d65461441ac15803a57e5ec79b96e9f7f2488cb05950978eb7630fb3fefab5d24b42dcb7974364e4fc001ef806bf63bc861e08ea5f533f775f5719165ebfec94ea"); break; case 30: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000003846000037276a00448f670acc0d43b40300000027d20000b88bb15a4dc95ab484c3bf1797f5528fd3c6cbf7061f78c4f41159d2508419c85efcd1701f988876f80956fbb70fa889843122ca639a809a5945cbacc2c84e946b4aa3d99628878791da7183a96dab687d7049917d3e853b0a65a5a892fa8a0371c38e87c255128b0b7b4941a2372905cda314f1593946fed17e10cdf7dc95e9b7d18966169001b4bf81bf0014eacae0a657fb2faad0de2774f93a1c61e529bdbb3e8ff138c15c6b471b96451ba16c9996f8443ed349111d8acc90a41983bb3ae7990af091bdb913db94d539e98fc69bf61888911ef1c7a0c69cd1987c447dadd09a87d0c0b7a3b241bcdc48cb674fa9"); break; case 31: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000912f000037276a00e2ab670acc0d43b4030000006fd100006bc50dfd92a9300863ec201a9faa795d50c04eea5e569c31c97c256cfc30242b31b49f86458f8c792b9da3cbffecefd14e81a1125bbe020a3a97355d4adde34fba1e978d80a9d99afd234b520d9fee107f8658b5dce6082f050a7bb9640e716a72a322e30011256d016407e5c7b60f1d717567e9049d26f6713fbd78243c0c288d90f2844264f9eff780dc7719f9786cf4061b3e902db9d022e64f5682af1e6632d8fc1e646b8fc93140aa2fee2e6eb2a1060ef47e7a0c5acf19121880ff6724d909d603804b6a6cf237a022874aa98ff68ff17e18613af256084ca83d31d46d"); break; case 32: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000e441000037276a00e8cc670acc0d43b40300000070d10000f3931e07e2258973431e92d511a4901419f4d3b52f97b191a6154e2c776da2c0b09a7680ec1fff9c006043ed5938c6e685e080e7d162db9bff6b165451787bac5ab9c1f27a67e39b4237ecda8fa1fde1b43a52c34c8c05adec8cf0cc55abf787b1e7766e0dbc659d560db207e05844ef9f9619bfaaf1dc43fd85c69fdce9d875bf2a87907774cf04c6854562cdbc6f3168215da3a486156b2f82a42f9f811fe71f9f1733cac579b79523259a2ebaf68d57bfe4fd4722afb6cf815bf330063caa9a0a75e536c9e4649e9a1abad934a5b1a898fd7d82547ff0ffcef30adacf869c"); break; } say("Температура ".$this->getProperty("temp").", влючена ионизация", 2); } } else // Ионизация отключена { if ($this->getProperty("turbo")) { // Включаем режим Турбо getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000a037000037276a00ccc7670acc0d43b40300000030d100006a051d1f451b45b43431b96d17cb5e991eee57b41f8c01fb8178f326fa33d7606ab078013b954af51fa4a2b9eb41f2c5c17aea5db8d9ae50da51716e377074a53cf3236a5815f38ba91cdd240f7072ba56cb2c8182793234a5e1924b794f1ab0360deeab1a797e9994c7822395bcfa6bb24cb8a9bf914ce1bfdc0285dc03236c4cd0120b38a06ce011f1964ce4480d8e79fed293dc4150a8e9bb3a1f1ffaa71fdb516b41369d2014499c3142c1fd51000a49c0f7deae8e68f9ed299c1ff4dba31cf6dc021ce092a97026505c6fdaab6d73a08ac8d6ece401a2eec326b7d27725"); say("Включен режим турбо", 2); } else { // Устанавливаем температуру switch ($this->getProperty("temp")) { case 18: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000009c41000037276a0006f7670acc0d43b403000000d0d00000a98891734ac8740b497c6f36d42138cb96ddf1d0fea0936cd765306afa29a815058f2395ce0fa0a126d164ed5eca435f562c32a810adb0abaeb54583490fe2f06478f0898047bccdc7fda11172008a14db714dd83fb18d513b1d240428a46aa6a7a4d796c95720d22e523f5ead4f75ebb796513619ffc13725d04c7b49e1745c0f9819e3877d597e201e6a02b0bf507ed377dbc8001e7610f93facb9aaf93051d036689860c6b854de9dd87ae57ecba6a9140ee6b89258ee8a50f9ed3cca1a945766ec8757dce2fdd55bdfbbc40bb1c7afc970971f3135b0f84612d2a046453a4eeebe05a64665c544cd0acfc44bc20e"); break; case 19: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000a93c000037276a0012c1670acc0d43b403000000f2d0000011dc2de96c693444515e38d403086bb9af4d8c6ca38ab9d868d0603eecbc0448dd0eac691c7511ad6a28c0f36e5d3b4a3f76c6a40d100457bc34d0a05edc4873ff54615f2150b5433beaabbb13467f70dc45fb64314160d9cf7f553968f9da41f0edb1c0929919c40d793f72f084a4ce6e7189617bca28190998a2b365e02d5bf4de22facd5ecf34ffe3d059ddf10a9d6cb9f8b4df01e180f38b8a22fef4f8e1f899aad5f56e87de9c45a6f186a19c70403cea9c5bb512ee4834f263f3a044180a747acc5e8d7ff9c806ce5fb97324da5d0b2230e570f5d159a36f2303bf8493"); break; case 20: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000a938000037276a004acd670acc0d43b403000000f3d000008dcc177787cc2972e454f376d4b67ef4c5d0dad775b939e089f8c2df9d4f553f314c845c25cf34ea46f8c5051d24c0c90d02fbd39c69efeec6270eb0d900e4a0ac96bb01011b849fe3bb02dcb0add8bebc49d1e9b77e880b116f12b155eaccda3f7135cd3c29bb5c55a4bd1d609b72b6ed943cca957c854b8529c6fc3125cf4f92a9a1235522e0c11e4c58253dbf03db699e4d9516a849e6466d64f024b39b305e9fadead4aace0f964684446e045ea7519f62657f9a51fb650431348d094e2053a5c7bed9ae9235785ffae1ae1d3f9df7040e96266d27bd774a135fc55501cd"); break; case 21: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000f534000037276a00aae8670acc0d43b403000000b5d000000739ebb0caf048bcd224c3829e03fe9f75e28fdb1438ae435fe23910d81cd94cf9aa81b1d5b5be0e5967957cab04f746f32b6b8056f885bd1bc44ce0781a3f8347168355dda1c045c40282008cf11b3329c661e34f7404f138339c1c09e3fbf4270aeb3802faac11e64f2dd9a7fdd7383445c8bdbe76e1943fb102251106c440869e06e8c4366d70b80b603e79a3d03f462ccc14897aa38fa53f1fc82bb67a34d385b19a6b2692cc3f2e375199110bca11226bc1d494c999acca1ba5508b7c386d4cf10d3ddd429c3d9f5324e3c5db0ba5c474d8786858c2377fb084ed2c354b"); break; case 22: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000783b000037276a00788c670acc0d43b403000000b3d000001362f37554e0950b4f8a6754ab6e5f3062ce746599e985d1c3be0fc13dbafac83b7b9a04ebd51b9d11a7be2464c6713aa9c3c839bab28a94b9fdc07094f82c9da2e4a0eef806ce5f6acaaaa4b0e74ead5c45c8437c2d2cc401078ab05f460119ed13206657a05e63ab30e606ce7bee02edc44e7ab9119fbd9def3330be48efd32da04709b4d6cf0f847e365b0c2f6e894d02f56523d4116a0c71ac35cf373fcec2a77f80560dd4b27da7c7f8daf835a65166a300fba186aac72f9b4d6c82074ba7c0c4a1859b7b9dcaf7626ab63ac13295b3f1d0e0e4a3c11ca87d7435808c32"); break; case 23: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000008e35000037276a00e69c670acc0d43b403000000f3d00000103b2afbf97fab8a73844d8f2f26c503d4327f1fbaf56c28dfb29cb2642bea51161801e47d7a7aa2bec610d6bae4390b2f63a26465dd828a3c49cc35ce7673ff665fe2a719ee62239c83a16719659d2d786b89339d611743ea438076bfbc10148b9fddfbad177ba0e16b47714b4602dc4aad3aebb3b9d6a9fb164a786624c7998c2140e27f94e9836e85ba67d03d3a31d79b5d104abe95a9331bf791f7ba9accf78610550ca04ec647473c0943eea6989235f00e6809ead1b74156ca1e264a3e08e492c363b77a50d6491f22609a87f1293792f0646f163c932a2144d2ede9da"); break; case 24: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000653b000037276a00fadf670acc0d43b403000000f2d000000739ebb0caf048bcd224c3829e03fe9f332320361cfdbf29f3d760cdd080d7e3e35ff082c099042c57b7adc9ecb7a15f61c230a2b41bf08c15a28a29a1fe23ed70a2bae2f188df0dccc9c6cc25397d006b713701229456bf53dd2e2e8b09df1bb7fcac627e96963aa1d4fbe98be42fbfc0b88c932ab23fcb03b3f27c11967b952c0b037be1ec2c17e6baafab6c1bf9bf297509f3aeb5f8b9dc1d2376f2f02eafc8cd6589e86c5b7cf87e1a933e2ba00ad77154e9b424add9531b5e785349cd01804060149f62b40b672e8913604137130d839fcd12e62d95071eb596bb09abbe"); break; case 25: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000002d3f000037276a0048fa670acc0d43b403000000f3d000000739ebb0caf048bcd224c3829e03fe9f375598b739c86fdb9e6dbe0d7df9dfb6968b40a46ff2ed23600d00b95b7543c11f6adf7f5bdbda34ef2d5cce845bad473251bdd3e78d2779ea8197358eb5e31cf873c8c3aad0f4b28ac7c19bd18b1cf3448aa8cd7a9c53c58d13cd92ccdc530f60081e9b0676c2750fa2c381fd3fe2d433fefd99b75f3e485494c0764f4569c62bdb890ca9d0c5bd801b422e5d54efbb21b0de1e48ec1dc500dffcdf4e32d4408eb97225f03f9e2f5e9ca2bfe5a877857927956dccfd1d6965051847a10ace8b87650fe194ca7a82739baa1bd6de31c6"); break; case 26: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000003338000037276a00e88e670acc0d43b403000000f2d00000a351157d7b6508485d0f746238cd9193e42e42cb6d367d6f3bd83982ba6bff47ad83398ade1b343db07f61dcb808e387f594e77a8ee2d569b8b4e8c2207aea60eb46852f6c7536e2b10ea2a1d918d4534528005af17fdb23873f868dde298a0a011dd121f81d3e128e5264c52bd954edf9c70f62c73e7f3115773ca8eb65de2313369f79ec9196841e6d943274b330e6f1e819efbf8390f3b82111d64bcd6a8d8662b82c2ab66f33c6918a0a4085bd1fdde6a4f788e6d6d57eb1caf348d87c41b13c46d0898cec6f05d3858731b23b21dcec422221f9014f4d3dada153c2522c"); break; case 27: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000007538000037276a00e48f670acc0d43b40300000032d10000ecd0aab75bfee08216113f097949c10130b6f9f50a742713df2a57e6da5fa4a6a76278dd91cf59720a56836368fff96bcd6be58a8473126d89eeaf3fefa911e22203f0ae513c655961b28940c59c46ded973405fd592183d4e9e5d045f07e60811481917ffb4802e064a124b5cea4c79246639fe4d4f6e7cdf63c3f88f38a4794c93c7c1d096f7d1b33fbc79840af161ed2261bcad71f4d310ddc448e07842929913164db2cd5075dcca2314ecb2885202d530fd1ecfea8ddcdb55867037f96cac69711c1fcf4d594c59a59b327bf957f3066dea85336600d2f9d39afb910135"); break; case 28: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000003339000037276a00dcad670acc0d43b40300000032d10000ecd0aab75bfee08216113f097949c101fbc9ded294e246f0953b4cd12c19a8ba0d39d0965823ee534b74c6bae10a710f4ac5b49d4ee9ca9bd453fb163fe0bce3313d257f18e3efa3b176525eb5876c64202da774165fb3f1545ba671628bf4f441d35089dc0977b328ae576d992ce2c8ebd0791c9bfc538ba1baad75ccbba57b701fca049353dba24f97d971ffdd4e4a82fcc725650fe22f5b96ff022820ab2430db27fd9c60e15a2e780c6c08746ac8e6c37533faa3de50fa00271040c107ed60dd21a0466d981f585b4d69dd4eb949b27d72084a8589941744a28319e32bd7"); break; case 29: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000843b000037276a0028a6670acc0d43b403000000f4d00000c292240cabe7ed3a89bd0b48afd0a2f344ab0914803d53b734c8b9ad17fa0c8ab6ad17df3f869a64b76db4e55fb02160112c262ede72182fbeea2880b18dae859d8082b87fe7355d79ddea67a046bc6519b304a297660c35f90d79226a6d3d066c1ba704b109b4fe168be1b474b19b33c70fc0ccb5e88de1d87bc40e3ff4f3e4d4eb09bd5541eb487490c531592cc1372bf0b4c01dbcdfeaf09bd43cf9626f640dfbf38f2d6a505c3132d04c707923888188e9b99fe2091fadb8fcb68bcc3653e23730ec0d88e7b62e7017f68ef5368eaae8b9b253e68309a0d596c92858f50a"); break; case 30: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000006337000037276a004893670acc0d43b403000000f0d0000071864dba7526f6980209d733915db757ba3e366546deac25f0205d73d1bf087fe462b61cace1651a10191717f0430a6a4e3dfe9633154232ea3d03b583e0b81026e1584db3f2564d13f929db04620dce7555aad2bc812ef965e2e56d3c40d64339cd0a8d26ff1ad5304d8e3184b4930612ff5b6bb8bca9e3c6a046c63301511fe5c68196b2db9a4906ee41ce317eed9ad10d7c7648baeb0cb58d03528f0bce09e6a53f09a5cdd6f2543a57782838ad67e94adeadccfb045e412eddcf335930e97f7d648b532083d6bbfde53b8014ebd7cd55b36bfdd3ebb5c1b9cd95f488508d"); break; case 31: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa55000000000000000000000000000000000000000000000000a937000037276a002490670acc0d43b4030000002fd100006d6b10820d6bfd270668931198d7234fb859e4bc46db00fe1d08cf192ef3862f9f2499df6220252bf439fcc1ff88eecdb9d8d65fbc10737d9a7846af27e744a9c461c6582b3ee2dc8476284fc7fbcc3a8bd0a12969407b364a38348bf01d347ccbd60aec79a6b91e54b670b7b251b78569e82fb4c37f70f8729fdb737a376d8ac5534be94144552442eb5e0d613432faef8d7263e9e628a1d9f19af2a02df30ec4d22a621566850ebbb7332daf6eb6fbb68a83ca5de58fcec40ea94ffa9dbea1baac0876290ee55d1a510e0e94ca45f730fc4302e9714f00178f92aeff0e9547"); break; case 32: getURL("http://localhost/objects/?script=BroadLinkCommand&ip=192.168.1.37&cmd=5aa5aa555aa5aa550000000000000000000000000000000000000000000000005b37000037276a00169d670acc0d43b40300000030d100007ff539a130eaaf585f498f4ccdf6730390e243f71d5a59e216858d40b9820bc89a67b0dd96e5cd2ef2e73953dab91c10763cabdc42cf0db44026a8950800f21df62a667910aa7b75ff586e1a9fed28f439d3d807039ce9e0d37433921ac1bf10d0a37b4e42abd0056b9f10dfd60261ce94a4a2b23456077060cba60fc34630e325dbc24b92225f5d42e57bfa3720f972b6a586a2b3bc1af7c17157efdf27274fb30be12c31a38c011679ee26886c9a82fed0e2b3e9aebfa613efc162c9d54d03b076954843149c9b5a3c1c14fdbb4b9b4bb4193d82184fa69f96bd136bc657bb"); break; } say("Температура ".$this->getProperty("temp"), 2); } } // Сохраняем параметры кондиционера $this->setProperty("turbo_old", $this->getProperty("turbo")); $this->setProperty("ion_old", $this->getProperty("ion"));
Объекты класса:
Свойства класса:
Методы класса:
$volume=round(65535*$params['VALUE']/100); $this->setProperty('volumeLevel',$params['VALUE']); safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume); say("Изменилась громкость до ".$params['VALUE']." процентов");
Объекты класса:
say("Отключено питание");
$command=$params['command']; $short_command=''; $dt=recognizeTime($command,$short_command); if (preg_match('/скажи сколько врем/is',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say('Сейчас '.timeNow(),2); } elseif (preg_match('/сколько время/is',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята'); echo $short_command; return; } say('Сейчас '.timeNow()); } elseif (preg_match('/повтори (.+)/is',$command,$m) || preg_match('/скажи (.+)/is',$command,$m)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say($m[1],2); } else { say('Неизвестная команда...',2); }
Свойства класса:
Методы класса:
//$params['t'] $this->setProperty("updated",time()); $this->setProperty("updatedTime",date("H:i",time())); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=30*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if (!isset($params['h'])) { return; } $old_temp=$this->getProperty('humidity'); $t=round($params['h'],1); if ($t>100) return; $this->setProperty('humidity',$t); if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); } if ($t>$old_temp) { $d=1; } elseif ($t<$old_temp) { $d=-1; } else { $d=0; } $this->setProperty('direction',$d); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Humidity',$t); }
Объекты класса:
Свойства класса:
Методы класса:
if ($params['status']) { $this->setProperty('status',$params['status']); } $this->setProperty('updatedTimestamp',time()); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=12*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
Свойства класса:
Методы класса:
$this->setProperty('status',$params['status']); // выставляем статус сенсора $this->setProperty('updatedTimestamp',time()); // выставляем время срабатывания сенсора $this->setProperty('alive',1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=24*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if ($params['status']) { $this->setProperty('motionDetected',1); clearTimeOut($this->object_title.'_detected'); setTimeOut($this->object_title.'_detected',"setGlobal('".$this->object_title.".motionDetected',0);",30); $linked_room=$this->getProperty('LinkedRoom'); if ($linked_room!='') { callMethod($linked_room.'.onActivity'); } if ($this->object_title=='sensorMovement3' || $this->object_title=='sensorMovementRemote1' || $this->object_title=='sensorMovementRemote2') { //|| $this->object_title=='sensorMovement5' return; // не реагируем на движение в спальне, по ip-сенсорам и по сенсору на втром этаже } ClearTimeOut("nobodyHome"); SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1*60*60); // выполняем если целый час никого не было if (getGlobal('NobodyHomeMode.active')) { callMethod('NobodyHomeMode.deactivate'); } $last_register=registeredEventTime('inhouseMovement'); // проверяем когда в последний раз срабатывало событие "движение внутри дома" registerEvent('inhouseMovement',$this->name,2); // регистрируем событие "движение внутри дома" if (timeBetween('05:00', '12:00') && ((time()-$last_register)>2*60*60)) { runScript('Greeting'); // запускаем скрипт "доброе утро" } }
Объекты класса:
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('active',1);
$this->setProperty('active',0);
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); if ($this->getProperty('active')) { say("Режим ".$this->getProperty('title')." активирован."); } else { say("Режим ".$this->getProperty('title')." выключен."); }
Объекты класса:
setGlobal('minMsgLevel','2');
setGlobal('minMsgLevel','1');
Свойства класса:
Методы класса:
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOn'); } else { $this->callMethod('turnOff'); }
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOff'); } else { $this->callMethod('turnOn'); }
$this->setProperty("status",1);
$this->setProperty("status",0);
Объекты класса:
Свойства класса:
Методы класса:
$cmdline='"c:\Program Files\nooLite\nooLite.exe" -api '.$params['command']; $last_called=gg('NoolightCommandSend'); $min_delay=3; $now=time(); if (($now-$last_called)>$min_delay) { //safe_exec($cmdline); $last_callled=$now; sg('NoolightCommandSend',$last_called); DebMes("Noolite instant exec: ".$cmdline); system($cmdline); //exec($cmdline); } else { if ($last_callled<$now) { $last_callled=$now; } $last_called+=$min_delay; sg('NoolightCommandSend',$last_called); DebMes("Noolite scheduled job for ".date('H:i:s',$last_called)); AddScheduledJob("noolight".md5($cmdline),"safe_exec('".$cmdline."');",$last_called); }
$this->setProperty("status",0); //safe_exec('"c:\Program Files\nooLite\noolite.exe" -api -off_ch'.$this->getProperty("channel")); $this->callMethod("sendCommand",array('command'=>'-off_ch'.$this->getProperty("channel")));
$this->setProperty("status",1); $this->callMethod("sendCommand",array('command'=>'-on_ch'.$this->getProperty("channel")));
Свойства класса:
Методы класса:
$code1=$this->getProperty('Code1'); $code2=$this->getProperty('Code2'); safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcoff$code1:$code2;"); $this->setProperty("status",0);
$code1=$this->getProperty('Code1'); $code2=$this->getProperty('Code2'); safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcon$code1:$code2;"); $this->setProperty("status",1);
Свойства класса:
Методы класса:
$rooms=getObjectsByClass("Rooms"); $total=count($rooms); for($i=0;$i<$total;$i++) { $rooms[$i]['room']=getGlobal($rooms[$i]['TITLE'].'.Title'); if (!$rooms[$i]['room']) { $rooms[$i]['room']=$rooms[$i]['TITLE']; } $rooms[$i]['active']=getGlobal($rooms[$i]['TITLE'].'.SomebodyHere'); $rooms[$i]['time']=getGlobal($rooms[$i]['TITLE'].'.LatestActivity'); $rooms[$i]['diff']=time()-$rooms[$i]['time']; } function cmp($a, $b) { if ($a['diff'] == $b['diff']) { return 0; } return ($a['diff'] < $b['diff']) ? -1 : 1; } usort($rooms,"cmp"); if (!$rooms[0]['active']) { $somebodyHomeText="Никого нет дома. Были в ".date('H:i',$rooms[0]['time'])." (".$rooms[0]['room'].")"; } else { $res_rooms=array(); for($i=0;$i<$total;$i++) { if ($rooms[$i]['active']) { $res_rooms[]=$rooms[$i]['room']; } } $somebodyHomeText="Кто-то дома: ".implode(", ",$res_rooms); } setGlobal('somebodyHomeText',$somebodyHomeText); //echo "Updated";
$latestActivity=$this->getProperty('LatestActivity'); $this->setProperty('LatestActivity',time()); $this->setProperty('LatestActivityTime',date('H:i')); $this->setProperty('SomebodyHere',1); $ot=$this->object_title; if ($this->getProperty("IdleDelay")) { $activity_timeout=(int)$this->getProperty("IdleDelay"); } else { $activity_timeout=10*60; } clearTimeOut($ot."_activity_timeout"); setTimeOut($ot."_activity_timeout","callMethod('".$ot.".onIdle');",$activity_timeout); $this->callMethod("updateActivityStatus");
$this->setProperty('SomebodyHere',0);
Объекты класса:
Свойства класса:
Методы класса:
$value = $this->getProperty("Value"); $val1 = round($value, 1); $val2 = round($value, 2); $this->setProperty("ValueRounded1",$val1); $this->setProperty("ValueRounded2",$val2);
Объекты класса:
Методы класса:
Объекты класса:
echo "status received: ".$params['status'];
global $voicemode; $voicemode='off'; processCommand($params['message']);
Свойства класса:
Методы класса:
Объекты класса:
$details=array(); $red_state=0; $yellow_state=0; if (!isOnline('Internet')) { $yellow_state=1; $details[]=LANG_GENERAL_NO_INTERNET_ACCESS; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
$details=array(); $red_state=0; $yellow_state=0; $cycles=array('states'=>'states','main'=>'main','execs'=>'exec','scheduler'=>'scheduler'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>5*60) { $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } $cycles=array('ping'=>'ping','webvars'=>'webvars'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>10*60) { $yellow_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
$details=array(); $red_state=0; $yellow_state=0; if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
Свойства класса:
Методы класса:
//$params['t'] $this->setProperty("updated",time()); $this->setProperty("updatedTime",date("H:i",time())); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=30*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if (!isset($params['t'])) { return; } $old_temp=$this->getProperty('temp'); $t=round($params['t'],1); if ($t>110) return; $this->setProperty('temp',$t); if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); } if ($t>$old_temp) { $d=1; } elseif ($t<$old_temp) { $d=-1; } else { $d=0; } $this->setProperty('direction',$d); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Temperature',$t); }
Объекты класса:
Свойства класса:
Методы класса:
/* START yaWeather module*/ $updateTime = gg('yw_setting.updateTime'); if($updateTime > 0){ $count = gg('yw_setting.countTime'); if($count >= $updateTime){ include_once(DIR_MODULES.'app_yaweather/app_yaweather.class.php'); $app_yaweather=new app_yaweather(); $app_yaweather->get_weather(gg('yw_setting.city_id')); sg('yw_setting.countTime',1); } else { $count++; sg('yw_setting.countTime',$count); } }/* END yaWeather*///START openweather module $updateTime = gg('ow_setting.updateTime'); if($updateTime > 0) { $count = gg('ow_setting.countTime'); if($count >= $updateTime) { include_once(DIR_MODULES . 'app_openweather/app_openweather.class.php'); $app_openweather = new app_openweather(); $app_openweather->get_weather(gg('ow_city.id')); sg('ow_setting.countTime', 1); } else { $count++; sg('ow_setting.countTime', $count); } } // END openweather module//START openweather module $updateTime = gg('ow_setting.updateTime'); if($updateTime > 0) { $count = gg('ow_setting.countTime'); if($count >= $updateTime) { include_once(DIR_MODULES . 'app_openweather/app_openweather.class.php'); $app_openweather = new app_openweather(); $app_openweather->get_weather(gg('ow_city.id')); sg('ow_setting.countTime', 1); } else { $count++; sg('ow_setting.countTime', $count); } } // END openweather module
Объекты класса:
$h=(int)date('G',time()); $m=date('i',time()); if (isWeekDay()) { } if (($h>=8) && getGlobal('clockChimeEnabled')) { if ($m=="00") { say(timeNow(),1); } } setGlobal('timeNow',date('H:i')); $homeStatus=date('H:i'); if (getGlobal('NobodyHomeMode.active')) { $homeStatus.=' Дома никого'; } else { $homeStatus.=' Дома кто-то есть'; } $homeStatus.=' '.getGlobal('Security.stateDetails'); $homeStatus.=' '.getGlobal('System.stateDetails'); $homeStatus.=' '.getGlobal('Communication.stateDetails'); setGlobal('HomeStatus',$homeStatus); if (timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')=="1") { setGlobal("isDark",0); callMethod('DarknessMode.deactivate'); } elseif (!timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')!="1") { setGlobal("isDark",1); callMethod('DarknessMode.activate'); } if (timeIs(getGlobal('SunRiseTime'))) { say('Всходит солнце'); } if (timeIs(getGlobal('SunSetTime'))) { say('Солнце заходит',2); } if (timeIs("23:30") && (gg("EconomMode.active")!="1") && (gg("NobodyHomeMode.active")=="1")) { say("Похоже никого нет сегодня, можно сэкономить немного."); callMethod('EconomMode.activate'); } if (timeIs('20:00')) { callMethod('NightMode.activate'); } elseif (timeIs('08:00')) { callMethod('NightMode.deactivate'); } if (timeIs("03:00")) { runScript("systemMaintenance"); } if (gg('ThisComputer.AlarmStatus') && timeIs(gg('ThisComputer.AlarmTime'))) { runScript('MorningAlarm'); }
Методы класса:
Объекты класса:
if ($params['serial']=='' && $params['devname']!='') { $params['serial']=$params['devname']; } $device=SQLSelectOne("SELECT * FROM usbdevices WHERE SERIAL LIKE '".$params['serial']."'"); if (!$device['ID']) { // new device connected //say("Подключено новое устройство",1); $device=array(); $device['SERIAL']=$params['serial']; $device['TITLE']='устройство '.$params['devname']; $device['FIRST_FOUND']=date('Y-m-d H:i:s'); $device['LAST_FOUND']=date('Y-m-d H:i:s'); $device['LOG'].=$device['FIRST_FOUND'].' подключено (впервые)'."\n"; $device['ID']=SQLInsert('usbdevices',$device); } else { // device already in our database //say("Подключено ".$device['TITLE'],1); if ($device['USER_ID']) { $user=SQLSelectOne("SELECT * FROM users WHERE ID='".$device['USER_ID']."'"); if ($user['ID']) { //$user['NAME']; // теперь мы знаем имя пользователя, связанного с этим устройством } } $device['LAST_FOUND']=date('Y-m-d H:i:s'); $device['LOG']=$device['LAST_FOUND'].' подключено'."\n".$device['LOG']; SQLUpdate('usbdevices',$device); if ($device['SCRIPT_ID']!='') { runScript($device['SCRIPT_ID'],$params); } elseif ($device['SCRIPT']!='') { eval($device['SCRIPT']); } }
Свойства класса:
Объекты класса:
Объекты класса:
, Россия
Веб-сайт:
http://www.youtube.com/channel/UChButpZaL5kUUl_zTyIDFkQ
© 2024 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving