[NF] Add Bot-Utils and rewrite code

This commit is contained in:
2018-06-07 20:49:54 +00:00
parent 022d1b8c2c
commit 38e965d79f
17 changed files with 492 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
using System;
namespace BlubbFish.Utils.IoT.Bots.Events {
public class CronEvent : ModulEventArgs {
public CronEvent() {
}
public CronEvent(String addr, String prop, String value) {
this.Address = addr;
this.Property = prop;
this.Value = value;
this.Source = "Cronjob";
}
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace BlubbFish.Utils.IoT.Bots.Events {
public class ModulEventArgs : EventArgs {
public ModulEventArgs() {
}
public String Address { get; protected set; }
public String Property { get; protected set; }
public String Value { get; protected set; }
public String Source { get; protected set; }
public override String ToString() {
return this.Source + ": " + this.Address + " set " + this.Property + " to " + this.Value;
}
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
namespace BlubbFish.Utils.IoT.Bots.Events {
public class MqttEvent : ModulEventArgs {
public MqttEvent() {
}
public MqttEvent(String topic, String text) {
this.Address = topic;
this.Value = text;
this.Source = "MQTT";
}
public override String ToString() {
return this.Source + ": on " + this.Address + " set " + this.Value;
}
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
namespace BlubbFish.Utils.IoT.Bots.Events {
public class OvertakerEvent : ModulEventArgs {
public OvertakerEvent() {
}
public OvertakerEvent(String addr, String prop, String value) {
this.Address = addr;
this.Property = prop;
this.Value = value;
this.Source = "Overtaker";
}
}
}
+16
View File
@@ -0,0 +1,16 @@
using System;
namespace BlubbFish.Utils.IoT.Bots.Events {
public class SenmlEvent : ModulEventArgs {
public SenmlEvent() {
}
public SenmlEvent(String topic, String text) {
this.Address = topic;
this.Value = text;
this.Source = "Senml";
}
public override String ToString() {
return this.Source + ": on " + this.Address + " set " + this.Value;
}
}
}
+18
View File
@@ -0,0 +1,18 @@
using System;
namespace BlubbFish.Utils.IoT.Bots.Events {
public class StatusPollingEvent : ModulEventArgs {
public StatusPollingEvent() {
}
public StatusPollingEvent(String text, String node) {
this.Value = text;
this.Address = node;
this.Source = "POLLING";
}
public override String ToString() {
return this.Source + ": " + this.Value + " on " + this.Address;
}
}
}