__init__.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pyelk 作者: BioSehnsucht 项目源码 文件源码
def connect(self, pyelk, address, ratelimit):
        """Connect to the Elk panel.

        address: Host to connect to in either
        "socket://IP.Add.re.ss:Port" or "/dev/ttyUSB0" format.
        ratelimit: rate limit for outgoing events
        """
        self._connection = serial.serial_for_url(address, timeout=1)
        self._connection_thread = serial.threaded.ReaderThread(self._connection, SerialInputHandler)
        self._connection_thread.start()
        self._connection_transport, self._connection_protocol = self._connection_thread.connect()
        self._connection_protocol.set_pyelk(pyelk)
        self._connection_output = SerialOutputHandler(ratelimit)
        self._connection_output.set_pyelk(pyelk)
        _LOGGER.debug('ReaderThread created')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号