Passed
Push — master ( 207a08...b801a7 )
by Matt
02:53
created

PyDMXControl.controllers._transmittingController.transmittingController.close()   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
"""
2
 *  PyDMXControl: A Python 3 module to control DMX using uDMX.
3
 *                Featuring fixture profiles, built-in effects and a web control panel.
4
 *  <https://github.com/MattIPv4/PyDMXControl/>
5
 *  Copyright (C) 2021 Matt Cowley (MattIPv4) ([email protected])
6
"""
7
8
from ._Controller import Controller
9
10
11
class transmittingController(Controller):
12
13
    def __init__(self, *args, **kwargs):
14
        super().__init__(*args, **kwargs)
15
16
        self.__auto = True
17
        if 'autostart' in kwargs:
18
            if isinstance(kwargs['autostart'], bool):
19
                self.__auto = kwargs['autostart']
20
21
        if self.__auto:
22
            self.run()
23
24
    def _send_data(self):
25
        pass
26
27
    def run(self):
28
        # Add the transmission of data to the ticker
29
        self.ticker.add_callback(self._send_data, 0)
30