Eurydike是一个简单的事件检测。对高于阈值、低于阈值和外部值带作出反应。

Eurydike的Python项目详细描述


_ρΨδ_κη/eurydike [wiki] 是一个简单的事件检测。对高于阈值,低于阈值, 以及外部价值带。

Pelops Overview

PELOPS概述

Eurydike是基于mqtt的微服务集合的一部分 pelops。微服务概述 架构和示例可以在 (http://gitlab.com/pelops/pelops)。

对于用户

安装核心功能

核心功能的先决条件是:

sudo apt install python3 python3-pip
sudo pip3 install paho-mqtt pyyaml pelops

通过PIP安装:

sudo pip3 install eurydike

若要更新到最新版本,请将--upgrade作为前缀添加到 pip3行以上。

通过Gitlab安装(可能需要其他软件包):

git clone git@gitlab.com:pelops/eurydike.git
cd eurydike
sudo python3 setup.py install

这将安装以下shell脚本:*eurydike

脚本cli参数是:*'-c'/'-config'-config文件 (必需)*'-v'-详细输出(可选)*'-版本'-显示 版本号和退出

yaml配置

yaml[1]文件必须包含四个根块:*mqtt-mqtt地址, MQTT端口和凭据文件的路径凭据文件(文件 包含两个条目:mqtt user,mqtt password)*logger- 日志级别和要使用的文件*事件检测器-参数 控制器和嵌入式pid

mqtt:
    mqtt-address: localhost
    mqtt-port: 1883
    credentials-file: ~/credentials.yaml
    log-level: INFO

logger:
    log-level: DEBUG  # DEBUG, INFO, WARNING, ERROR, CRITICAL
    log-file: test_eurydike.log

eventdetectors:
    - name: above  # unqiue name for event detector
      type: onthreshold  # detector type identifier
      comparator: gt  # GREATERTHAN/GT/>, LOWERTHAN/LT/<, EQUALTO/==
      threshold: 7  # threshold in combintation with comparator and value from topic-sub
      topic-sub: /test/value
      topic-pub: /test/above
      responses:  # leave value empty or remove line for no response
#          on-violation: event_detected  # on detection of a threshold violation send this value to topic-pub
          on-restoration: event_ended  # on the event of returning to valid values send this value to topic-pub
      active: False  # entry ignored if set to False

    - name: below  # unqiue name for event detector
      type: onthreshold  # detector type identifier
      comparator: lowerthan  # GREATERTHAN/GT/>, LOWERTHAN/LT/<, EQUALTO/==
      threshold: 7  # threshold in combintation with comparator and value from topic-sub
      topic-sub: /test/value
      topic-pub: /test/below
      responses:  # leave value empty or remove line for no response
          on-violation: event_detected  # on detection of a threshold violation send this value to topic-pub
          on-restoration: event_ended  # on the event of returning to valid values send this value to topic-pub
      active: True  # entry ignored if set to False

    - name: equal  # unqiue name for event detector
      type: onthreshold  # detector type identifier
      comparator: ==  # GREATERTHAN/GT/>, LOWERTHAN/LT/<, EQUALTO/==
      threshold: 7  # threshold in combintation with comparator and value from topic-sub
      topic-sub: /test/value
      topic-pub: /test/equal
      responses:  # leave value empty or remove line for no response
          on-violation: event_detected  # on detection of a threshold violation send this value to topic-pub
          on-restoration:  # on the event of returning to valid values send this value to topic-pub
      active: False  # entry ignored if set to False

    - name: outside  # unqiue name for event detector
      type: onband  # detector type identifier
      upper-threshold: 8  # upper threshold for on band detection
      lower-threshold: 7  # lower threshold for on band detection
      topic-sub: /test/value
      topic-pub: /test/band
      responses:  # leave value empty or remove line for no response
          on-violation: event_detected  # on detection of a threshold violation send this value to topic-pub
          on-restoration: event_ended  # on the event of returning to valid values send this value to topic-pub
      active: True  # entry ignored if set to False

系统d

  • 添加systemd示例。

对于开发人员

开始

该项目由两个主要模块组成:

  • eventdetectionmanager-管理所有配置的事件检测器
  • abstracteventdetector-所有事件检测器的基类

待办事项

  • …?

其他

代码是为python3编写的(并在 覆盆子皮零与覆盆子伸展)。

Merge requests/ bug reports总是 欢迎。

[1]Currently, pyyaml is yaml 1.1 compliant. In pyyaml On/Off and Yes/No are automatically converted to True/False. This is an unwanted behavior and deprecated in yaml 1.2. In copreus this autoconversion is removed. Thus, On/Off and Yes/No are read from the yaml file as strings (see module baseclasses.myconfigtools).

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
DB H2和控制器的java集成测试   程序未通过if语句(Java)   java如何解决JPA更新时数据库中NOTNULL的值   3DES,Java代码结果产生不同于3DES在线工具和oracle数据库脚本的结果   java是否可以在XML中设置SwipeRefreshLayout的颜色方案?   java为什么JRBeanCollectionDataSource使用jr:List组件提供传递List的空字段?   java ScrollView只能托管一个直接子安卓   java是否有更短的代码或更简单的方法将元素添加到不同大小的多个数组中?   java为什么示例作者要硬编码正交摄影机的宽度和高度?(LibGdx僵尸鸟教程)   java不断得到非法的类型错误的开始,我如何才能纠正这一点并继续前进?   java如何获取正在运行的应用程序名称并将其与安卓上数据库中记录的名称进行匹配?   用于Java和if循环代码优化的if语句   if语句如果在JAVA中没有花括号,为什么if块可以放在另一个if块中   安卓操作系统。FileUriExposedException:file:///storage/emulated/0/test.txt通过意图暴露在应用程序之外。getData()   java索引不是错误,而是索引+索引=错误   java Android从改造调用中获取实时数据   java Tictaoe打印电路板   java Guice IoC怎么样?   java JLabel设置为文本列表项   java Hibernate MasterSubDetails映射