Skip to content

Commit 6576fd0

Browse files
author
James Boulton
committed
Remove unneeded imports. Disable the old actions
1 parent effdd57 commit 6576fd0

6 files changed

Lines changed: 5 additions & 25 deletions

File tree

dashio/dash_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class DashConnection(threading.Thread):
130130
Methods
131131
-------
132132
add_device(Device) :
133-
add a Deive to the connection
133+
add a Device to the connection
134134
set_connection(username, password):
135135
change the connection username and password
136136
close() :
@@ -177,7 +177,7 @@ def _on_log(self, client, obj, level, string):
177177
logger.debug(string)
178178

179179
def add_device(self, device):
180-
"""Add a Device to the connextion
180+
"""Add a Device to the connection
181181
182182
Parameters
183183
----------

dashio/device.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import zmq
3131

3232
from .constants import CONNECTION_PUB_URL, BAD_CHARS
33-
from .action_station import ActionStation
3433
from .iotcontrol.alarm import Alarm
3534
from .iotcontrol.device_view import DeviceView
3635
from .iotcontrol.enums import ControlName
@@ -575,8 +574,6 @@ def register_connection(self, connection):
575574
self.connections_list.append(connection.zmq_connection_uuid)
576575
self.rx_zmq_sub.connect(CONNECTION_PUB_URL.format(id=connection.zmq_connection_uuid))
577576
connection.rx_zmq_sub.connect(CONNECTION_PUB_URL.format(id=self.zmq_connection_uuid))
578-
if self._add_actions:
579-
self.action_station.register_connection(connection)
580577

581578
def de_register_connection(self, connection):
582579
"""Connections unregistered here"""
@@ -585,16 +582,12 @@ def de_register_connection(self, connection):
585582
self.connections_list.remove(connection.zmq_connection_uuid)
586583
self.rx_zmq_sub.disconnect(CONNECTION_PUB_URL.format(id=connection.zmq_connection_uuid))
587584
connection.rx_zmq_sub.disconnect(CONNECTION_PUB_URL.format(id=self.zmq_connection_uuid))
588-
if self._add_actions:
589-
self.action_station.register_connection(connection)
590-
self.action_station.de_register_connection(connection)
591585

592586
def __init__(
593587
self,
594588
device_type: str,
595589
device_id: str,
596590
device_name: str,
597-
add_actions: bool = False,
598591
cfg_dict: dict | None = None,
599592
context: zmq.Context | None = None
600593
) -> None:
@@ -610,8 +603,6 @@ def __init__(
610603
The name for this device
611604
cfg_dict : dict optional
612605
Setup dict to cfgRev and adds controls defined in cfg_dict, defaults None
613-
add_actions : boolean
614-
To include actions or not, defaults false
615606
context : optional
616607
ZMQ context. Defaults to None.
617608
"""
@@ -649,12 +640,6 @@ def __init__(
649640
self.add_all_c64_controls(cfg_dict)
650641
self.use_cfg64()
651642

652-
self._add_actions = add_actions
653-
if self._add_actions:
654-
self._add_action_device_setup(True)
655-
self.action_station = ActionStation(self, context=self.context)
656-
time.sleep(0.5)
657-
self.action_station.device_zmq_sub.connect(CONNECTION_PUB_URL.format(id=self.zmq_connection_uuid))
658643
self.running = True
659644
time.sleep(0.5)
660645
self.start()
@@ -724,8 +709,6 @@ def device_name(self, val: str):
724709

725710
def close(self):
726711
"""Close the device"""
727-
if self._add_actions:
728-
self.action_station.close()
729712
self.running = False
730713

731714
def _local_command(self, msg_dict):

python-dashio.code-workspace

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"editor.formatOnSave": true
1515
},
1616
"cSpell.words": [
17-
"dashio"
17+
"dashio",
18+
"mqtt"
1819
]
1920
},
2021
"extensions": {

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ python-dateutil
44
zeroconf
55
shortuuid
66
pyserial
7-
astral
8-
pydantic

setup.cfg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ install_requires =
2323
zeroconf
2424
shortuuid
2525
pyserial
26-
astral
27-
pydantic
2826

2927
python_requires = >=3.7.0
3028
zip_safe = no

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package_data={"dashio": ["py.typed"]},
1818
license="MIT",
1919
classifiers=["Programming Language :: Python :: 3.8", "Operating System :: OS Independent"],
20-
install_requires=["paho-mqtt>=2.0.0", "pyzmq", "python-dateutil", "zeroconf", "shortuuid", "pyserial", "astral", "pydantic"],
20+
install_requires=["paho-mqtt>=2.0.0", "pyzmq", "python-dateutil", "zeroconf", "shortuuid", "pyserial"],
2121
python_requires='>=3.8.0',
2222
scripts=['utilities/c64_encode', 'utilities/c64_decode'],
2323
)

0 commit comments

Comments
 (0)