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:
BlubbFish 2018-10-02 14:53:59 +00:00
parent 26a0688dae
commit 83cb131efe
13 changed files with 26 additions and 9 deletions

View File

@ -21,12 +21,14 @@ namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
#region Mqtt
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.MessageIncomming += this.MqttUpdate;
this.mqttConnect = true;
}
protected override void Disconnect() {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Mqtt.Disconnect()");
this.mqttConnect = false;
if (this.mqtt != null) {
this.mqtt.MessageIncomming -= this.MqttUpdate;

View File

@ -16,20 +16,25 @@ namespace BlubbFish.IoT.Bots.ZwayBot.Moduls {
public Overtaker(ZwayController zway, InIReader settings) : base(zway, settings) { }
protected override void LibraryUpdateHook(String id) {
foreach (KeyValuePair<String, ACommandClass> item in this.overtakeritems) {
item.Value.Polling = false;
item.Value.Update -= this.HandleLibUpdate;
}
this.overtakeritems.Clear();
protected override void AddLibraryUpdateHook(String id) {
ACommandClass c = this.library.GetCommandClass(id);
if (c != null) {
Console.WriteLine("BlubbFish.IoT.Bots.ZwayBot.Moduls.Overtaker.LibraryUpdateHook: Add Watcher to " + c.Name + " [" + c.Id + "]");
this.overtakeritems.Add(id, c);
c.Polling = true;
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) {
try {
DeviceUpdateEvent e = state as DeviceUpdateEvent;

View File

@ -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
protected override void LibUpadteThread(Object state) {
try {

View File

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("BlubbFish")]
[assembly: AssemblyProduct("Zway-Bot")]
[assembly: AssemblyCopyright("Copyright © 2017 - 29.09.2018")]
[assembly: AssemblyCopyright("Copyright © 2017 - 02.10.2018")]
[assembly: AssemblyTrademark("BlubbFish")]
[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,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.1")]
[assembly: AssemblyFileVersion("1.7.1")]
[assembly: AssemblyVersion("1.7.2")]
[assembly: AssemblyFileVersion("1.7.2")]
[assembly: NeutralResourcesLanguage("de-DE")]
// “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.