Skip to content

Commit bd1bbc2

Browse files
author
James Boulton
committed
set proper cfgRev defaults
1 parent 5e54ec7 commit bd1bbc2

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

dashio/dash_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@
2222
SOFTWARE.
2323
"""
2424
from __future__ import annotations
25+
2526
import json
2627
import logging
2728
import ssl
2829
import threading
2930
import time
30-
3131
from socket import gaierror
32+
3233
import paho.mqtt.client as mqtt
3334
import shortuuid
3435
import zmq
3536

3637
from .constants import CONNECTION_PUB_URL
3738
from .iotcontrol.enums import ConnectionState
3839

39-
4040
logger = logging.getLogger(__name__)
4141

4242

@@ -341,7 +341,7 @@ def run(self):
341341
control_type = ""
342342
while self.running:
343343
try:
344-
socks = dict(poller.poll(1))
344+
socks = dict(poller.poll(10 ))
345345
except zmq.error.ContextTerminated:
346346
break
347347

dashio/device.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,21 @@
2222
SOFTWARE.
2323
"""
2424
from __future__ import annotations
25+
2526
import json
2627
import logging
2728
import threading
2829
import time
30+
2931
import shortuuid
3032
import zmq
3133

32-
from .constants import CONNECTION_PUB_URL, BAD_CHARS
34+
from .constants import BAD_CHARS, CONNECTION_PUB_URL
3335
from .iotcontrol.alarm import Alarm
3436
from .iotcontrol.device_view import DeviceView
3537
from .iotcontrol.enums import ControlName
36-
from .load_config import encode_cfg64
37-
from .load_config import CONTROL_INSTANCE_DICT, CONFIG_INSTANCE_DICT
38-
38+
from .load_config import (CONFIG_INSTANCE_DICT, CONTROL_INSTANCE_DICT,
39+
encode_cfg64)
3940

4041
logger = logging.getLogger(__name__)
4142

@@ -633,6 +634,7 @@ def __init__(
633634
self.controls_dict = {}
634635
self._cfg = {}
635636
self._cfg["deviceSetup"] = ''
637+
self._cfg["cfgRev"] = 1
636638
self._device_id_str = f"\t{device_id}"
637639
self._cfg["numDeviceViews"] = 0
638640
if cfg_dict is not None:
@@ -752,3 +754,4 @@ def run(self):
752754
self.tx_zmq_pub.close()
753755
self.rx_zmq_sub.close()
754756
self.context.term()
757+
self.context.term()

0 commit comments

Comments
 (0)