82 lines
2.0 KiB
C#
82 lines
2.0 KiB
C#
using System;
|
|
|
|
namespace ZwayBot {
|
|
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";
|
|
}
|
|
}
|
|
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";
|
|
}
|
|
}
|
|
|
|
public class Flex4gridEvent : ModulEventArgs {
|
|
public Flex4gridEvent() {
|
|
}
|
|
public Flex4gridEvent(String topic, String text) {
|
|
this.Address = topic;
|
|
this.Value = text;
|
|
this.Source = "Flex4Grid";
|
|
}
|
|
public override String ToString() {
|
|
return this.Source + ": on " + this.Address + " set " + this.Value;
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|