在Python Openz上设置轮询间隔

2024-05-16 21:11:12 发布

您现在位置:Python中文网/ 问答频道 /正文

如何为Python Openzwave上的设备设置轮询间隔。命令 network.set_轮询_间隔(time)似乎不会更改默认轮询间隔

编码

network = ZWaveNetwork(options, autostart=False)

dispatcher.connect(louie_network_started,ZWaveNetwork.SIGNAL_NETWORK_STARTED)
dispatcher.connect(louie_network_failed, ZWaveNetwork.SIGNAL_NETWORK_FAILED)
dispatcher.connect(louie_network_ready, ZWaveNetwork.SIGNAL_NETWORK_READY)


network.start()
network.set_poll_interval(1000)
print network.get_poll_interval()  

这里它似乎被设置为指定的值

^{pr2}$

这里它重置为默认值


Tags: 命令编码signal间隔timeconnectnetworkinterval
1条回答
网友
1楼 · 发布于 2024-05-16 21:11:12

inline documentation of ^{}'s ^{}来看,函数不是set_polling_interval,而是实际上

def set_poll_interval(self, milliseconds=500, bIntervalBetweenPolls=True):

其中milliseconds

[the] length of the polling interval in milliseconds

并且bIntervalBetweenPolls是一个布尔值,它

[if] set to true (via SetPollInterval), the pollInterval will be interspersed between each poll (so a much smaller m_pollInterval like 100, 500, or 1,000 may be appropriate). If false, the library attempts to complete all polls within m_pollInterval.

相关问题 更多 >