*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 5465b4ee authored by Schabbauer, Johannes's avatar Schabbauer, Johannes
Browse files

Test bugfix for TimeBase Sweep mode

parent 40682449
No related branches found
No related tags found
No related merge requests found
......@@ -35,10 +35,28 @@ class TimeBaseWorker(Worker):
for channel in group:
for attr,value in group[channel].attrs.items():
if self.smart_cache[channel][attr] != group[channel].attrs[attr] or fresh:
# Disable sweep mode, if it was in use.
# This is necessary is update the sweep mode parameters.
if self.smart_cache["Sswpm"] != 0:
print(f"Programming {channel}, Sswpm=0")
self.client.send(f"{channel}|Sswpm:0\r\n".encode())
self.smart_cache["Sswpm"] = 0
time.sleep(0.01)
if attr == "Sswpm":
# Skip sweep mode, becasue I want to enable it only after
# setting all other values
continue
print(f"Programming {channel}, {attr}")
self.client.send(f"{channel}|{attr}:{value:.0f}\r\n".encode())
self.smart_cache[channel][attr] = group[channel].attrs[attr]
time.sleep(0.01) # TODO: What's the best time here? Do we need to wait at all?
time.sleep(0.01) # TODO: What's the best time here? Do we need to wait at all? According to the DIM-3000 manual the rate is 10 commands per second, it seems router can also handle faster times?
# Program actual value of sweep mode
if group[channel]["Sswpm"] != 0:
print(f"Programming {channel}, Sswpm")
self.client.send(f"{channel}|Sswpm:{group[channel]['Sswpm']}\r\n".encode())
self.smart_cache["Sswpm"] = {group[channel]['Sswpm']}
time.sleep(0.01)
if not initial_values[channel]["gate"]:
print(f"Programming {channel}, Sout")
self.client.send(f"{channel}|Sout:1\r\n".encode())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment