本文整理汇总了Python中janitoo.component.JNTComponent.stop方法的典型用法代码示例。如果您正苦于以下问题:Python JNTComponent.stop方法的具体用法?Python JNTComponent.stop怎么用?Python JNTComponent.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类janitoo.component.JNTComponent
的用法示例。
在下文中一共展示了JNTComponent.stop方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""Stop the component.
"""
self.stop_check()
JNTComponent.stop(self)
return True
示例2: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""
"""
self.stop_listen()
JNTComponent.stop(self)
if self._bus.spi_locked():
logger.warning('[%s] - Bus is locked. Close device anyway.', self.__class__.__name__)
if self.pn532 is not None:
self.pn532.close()
self._bus.spi_acquire()
try:
self.pn532.close()
except Exception:
logger.exception('[%s] - Exception when stopping', self.__class__.__name__)
finally:
self.pn532 = None
self._bus.spi_release()
示例3: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""Stop the component.
"""
if self.mqttc_values is not None:
try:
hadd = HADD%(self.remote_hadd[0], self.remote_hadd[1])
values_read = self.get_read_values()
topics = []
for value in values_read:
if value[0] == 'user':
topic=TOPIC_VALUES_USER
else:
topic=TOPIC_VALUES_BASIC
topic = topic%(HADD%(self.remote_hadd)+'/'+value[1])
topics.append(topic)
logger.debug("[%s] - Unsubscribe to %s", self.__class__.__name__, topics)
self.mqttc_values.unsubscribe(topics)
self.mqttc_values.stop()
if self.mqttc_values.is_alive():
self.mqttc_values.join()
self.mqttc_values = None
except Exception:
logger.exception("[%s] - stop", self.__class__.__name__)
if self.mqttc_heartbeat is not None:
try:
hadd = HADD%(self.remote_hadd[0], self.remote_hadd[1])
logger.debug("[%s] - Unsubscribe to %s", self.__class__.__name__, TOPIC_HEARTBEAT_NODE%(hadd))
self.mqttc_heartbeat.unsubscribe(topic=TOPIC_HEARTBEAT_NODE%(hadd))
self.mqttc_heartbeat.stop()
if self.mqttc_heartbeat.is_alive():
self.mqttc_heartbeat.join()
self.mqttc_heartbeat = None
except Exception:
logger.exception("[%s] - stop", self.__class__.__name__)
JNTComponent.stop(self)
return True
示例4: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""Stop the component.
"""
JNTComponent.stop(self)
return True
示例5: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""
"""
JNTComponent.stop(self)
self.sensor = None
示例6: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""
"""
JNTComponent.stop(self)
self.display = None
示例7: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""Stop the component.
"""
self._bus.nodeman.remove_daily_job(self.current_rotate)
return JNTComponent.stop(self)
示例8: stop
# 需要导入模块: from janitoo.component import JNTComponent [as 别名]
# 或者: from janitoo.component.JNTComponent import stop [as 别名]
def stop(self):
"""
"""
JNTComponent.stop(self)
self.clock = None