Zway-Bot [v1.7.2] Add Logging to some Modules, fixing a bug in overtaker (now it not removes every time all events, so only the latest event are watched)
[Utils] Fixing a bug if more than one argument with params
This commit is contained in:
parent
26a0688dae
commit
83cb131efe
@ -21,12 +21,14 @@ namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
|
|||||||
|
|
||||||
#region Mqtt
|
#region Mqtt
|
||||||
protected override void Connect() {
|
protected override void Connect() {
|
||||||
|
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.Connect()");
|
||||||
this.mqtt = ABackend.GetInstance(this.config["settings"], ABackend.BackendType.Data);
|
this.mqtt = ABackend.GetInstance(this.config["settings"], ABackend.BackendType.Data);
|
||||||
this.mqtt.MessageIncomming += this.MqttUpdate;
|
this.mqtt.MessageIncomming += this.MqttUpdate;
|
||||||
this.mqttConnect = true;
|
this.mqttConnect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Disconnect() {
|
protected override void Disconnect() {
|
||||||
|
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.Disconnect()");
|
||||||
this.mqttConnect = false;
|
this.mqttConnect = false;
|
||||||
if (this.mqtt != null) {
|
if (this.mqtt != null) {
|
||||||
this.mqtt.MessageIncomming -= this.MqttUpdate;
|
this.mqtt.MessageIncomming -= this.MqttUpdate;
|
||||||
|
@ -16,20 +16,25 @@ namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
|
|||||||
|
|
||||||
public Overtaker(ZwayController zway, InIReader settings) : base(zway, settings) { }
|
public Overtaker(ZwayController zway, InIReader settings) : base(zway, settings) { }
|
||||||
|
|
||||||
protected override void LibraryUpdateHook(String id) {
|
protected override void AddLibraryUpdateHook(String id) {
|
||||||
foreach (KeyValuePair<String, ACommandClass> item in this.overtakeritems) {
|
|
||||||
item.Value.Polling = false;
|
|
||||||
item.Value.Update -= this.HandleLibUpdate;
|
|
||||||
}
|
|
||||||
this.overtakeritems.Clear();
|
|
||||||
ACommandClass c = this.library.GetCommandClass(id);
|
ACommandClass c = this.library.GetCommandClass(id);
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
|
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Overtaker.LibraryUpdateHook: Add Watcher to " + c.Name + " [" + c.Id + "]");
|
||||||
this.overtakeritems.Add(id, c);
|
this.overtakeritems.Add(id, c);
|
||||||
c.Polling = true;
|
c.Polling = true;
|
||||||
c.Update += this.HandleLibUpdate;
|
c.Update += this.HandleLibUpdate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void RemoveLibraryUpdateHooks() {
|
||||||
|
foreach (KeyValuePair<String, ACommandClass> item in this.overtakeritems) {
|
||||||
|
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Overtaker.LibraryUpdateHook: Remove Watcher to " + item.Value.Name + " [" + item.Value.Id + "]");
|
||||||
|
item.Value.Polling = false;
|
||||||
|
item.Value.Update -= this.HandleLibUpdate;
|
||||||
|
}
|
||||||
|
this.overtakeritems.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void LibUpadteThread(Object state) {
|
protected override void LibUpadteThread(Object state) {
|
||||||
try {
|
try {
|
||||||
DeviceUpdateEvent e = state as DeviceUpdateEvent;
|
DeviceUpdateEvent e = state as DeviceUpdateEvent;
|
||||||
|
@ -19,6 +19,16 @@ namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Connect() {
|
||||||
|
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Senml.Connect()");
|
||||||
|
base.Connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Disconnect() {
|
||||||
|
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Senml.Disconnect()");
|
||||||
|
base.Disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
#region Events
|
#region Events
|
||||||
protected override void LibUpadteThread(Object state) {
|
protected override void LibUpadteThread(Object state) {
|
||||||
try {
|
try {
|
||||||
|
@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("BlubbFish")]
|
[assembly: AssemblyCompany("BlubbFish")]
|
||||||
[assembly: AssemblyProduct("Zway-Bot")]
|
[assembly: AssemblyProduct("Zway-Bot")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2017 - 29.09.2018")]
|
[assembly: AssemblyCopyright("Copyright © 2017 - 02.10.2018")]
|
||||||
[assembly: AssemblyTrademark("BlubbFish")]
|
[assembly: AssemblyTrademark("BlubbFish")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@ -31,8 +31,8 @@ using System.Runtime.InteropServices;
|
|||||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||||
// übernehmen, indem Sie "*" eingeben:
|
// übernehmen, indem Sie "*" eingeben:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.7.1")]
|
[assembly: AssemblyVersion("1.7.2")]
|
||||||
[assembly: AssemblyFileVersion("1.7.1")]
|
[assembly: AssemblyFileVersion("1.7.2")]
|
||||||
[assembly: NeutralResourcesLanguage("de-DE")]
|
[assembly: NeutralResourcesLanguage("de-DE")]
|
||||||
|
|
||||||
// “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.
|
// “Internet Of Things” icon by By Michael Wohlwend, US, from thenounproject.com.
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user