Kleine Fehler behoben

This commit is contained in:
BlubbFish 2017-10-01 21:56:43 +00:00
parent 27f12d5bae
commit ef55750312
3 changed files with 15 additions and 15 deletions

View File

@ -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<String, String> settings) : base(settings) {
public Luminanz(Dictionary<String, String> 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;
}
}
}

View File

@ -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<String, String> settings) : base(settings) {
public Pir(Dictionary<String, String> 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;
}
}
}

View File

@ -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<String, String> settings) : base(settings) {
public Temperatur(Dictionary<String, String> 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;
}
}
}