-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path33_neopool.be
38 lines (30 loc) · 1.07 KB
/
33_neopool.be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#######################################################################
# PROPERTY OF QILOWATT.IT #
# DISCLOSURE OR COPYING IS STRICTLY PROHIBITED AND MAY BE UNLAWFUL. #
#######################################################################
class NeoPool
def init()
# Init driver
tasmota.add_driver(self)
tasmota.add_rule("POWER1#State", / args -> self.toggle_pool(args))
end
def toggle_pool(state)
# Turn pool ON
if state == 1
# Filtration ON
tasmota.cmd("NPFiltration 1")
log("[QW][NeoPool] Filtration ON", 2)
# Wait 15 seconds, then turn mode to HEAT
tasmota.set_timer(1000 * 15, def ()
tasmota.cmd("NPFiltrationmode 2")
log("[QW][NeoPool] Filtration mode HEAT", 2)
end)
# Turn pool OFF
elif state == 0
# Filtration OFF
tasmota.cmd("NPFiltration 0")
log("[QW][NeoPool] Filtration OFF", 2)
end
end
end
NeoPool()