From ef55750312e20f636ac41c78b71aa1ecb555db60 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Sun, 1 Oct 2017 21:56:43 +0000 Subject: [PATCH] Kleine Fehler behoben --- Mqtt-Dashboard/Sensor/Luminanz.cs | 10 +++++----- Mqtt-Dashboard/Sensor/Pir.cs | 10 +++++----- Mqtt-Dashboard/Sensor/Temperatur.cs | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Mqtt-Dashboard/Sensor/Luminanz.cs b/Mqtt-Dashboard/Sensor/Luminanz.cs index 7e9d0a6..ef80eee 100644 --- a/Mqtt-Dashboard/Sensor/Luminanz.cs +++ b/Mqtt-Dashboard/Sensor/Luminanz.cs @@ -1,20 +1,20 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Text; -using uPLibrary.Networking.M2Mqtt.Messages; +using Dashboard.Connector; namespace Dashboard.Sensor { class Luminanz : ASensor { - public Luminanz(Dictionary settings) : base(settings) { + public Luminanz(Dictionary settings, String name, ADataBackend backend) : base(settings, name, backend) { this.GetBool = true; this.GetFloat = 0.0f; this.GetInt = 0; this.Datatypes = Types.Int; } - protected override void UpdateValue(MqttMsgPublishEventArgs e) { - this.GetInt = Int32.Parse(Encoding.UTF8.GetString(e.Message), new CultureInfo("en-US")); + protected override Boolean UpdateValue(MqttEventArgs e) { + this.GetInt = Int32.Parse(e.Message, new CultureInfo("en-US")); + return true; } } } diff --git a/Mqtt-Dashboard/Sensor/Pir.cs b/Mqtt-Dashboard/Sensor/Pir.cs index f6804c6..69eed7e 100644 --- a/Mqtt-Dashboard/Sensor/Pir.cs +++ b/Mqtt-Dashboard/Sensor/Pir.cs @@ -1,16 +1,16 @@ using System; using System.Collections.Generic; -using System.Text; -using uPLibrary.Networking.M2Mqtt.Messages; +using Dashboard.Connector; namespace Dashboard.Sensor { class Pir : ASensor { - public Pir(Dictionary settings) : base(settings) { + public Pir(Dictionary settings, String name, ADataBackend backend) : base(settings, name, backend) { this.Datatypes = Types.Bool; } - protected override void UpdateValue(MqttMsgPublishEventArgs e) { - this.GetBool = (Encoding.UTF8.GetString(e.Message).ToLower() == "on") ? true : false; + protected override Boolean UpdateValue(MqttEventArgs e) { + this.GetBool = (e.Message.ToLower() == "on") ? true : false; + return true; } } } \ No newline at end of file diff --git a/Mqtt-Dashboard/Sensor/Temperatur.cs b/Mqtt-Dashboard/Sensor/Temperatur.cs index b86a283..8474531 100644 --- a/Mqtt-Dashboard/Sensor/Temperatur.cs +++ b/Mqtt-Dashboard/Sensor/Temperatur.cs @@ -1,20 +1,20 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Text; -using uPLibrary.Networking.M2Mqtt.Messages; +using Dashboard.Connector; namespace Dashboard.Sensor { class Temperatur : ASensor { - public Temperatur(Dictionary settings) : base(settings) { + public Temperatur(Dictionary settings, String name, ADataBackend backend) : base(settings, name, backend) { this.GetBool = true; this.GetFloat = 0.0f; this.GetInt = 0; this.Datatypes = Types.Float; } - protected override void UpdateValue(MqttMsgPublishEventArgs e) { - this.GetFloat = Single.Parse(Encoding.UTF8.GetString(e.Message), new CultureInfo("en-US")); + protected override Boolean UpdateValue(MqttEventArgs e) { + this.GetFloat = Single.Parse(e.Message, new CultureInfo("en-US")); + return true; } } } \ No newline at end of file