Utils/IoT/Sensor/Temperatur.cs

20 lines
620 B
C#
Raw Normal View History

2017-10-02 18:26:38 +02:00
using System;
using System.Collections.Generic;
using System.Globalization;
using BlubbFish.Utils.IoT.Connector;
namespace BlubbFish.Utils.IoT.Sensor {
class Temperatur : ASensor {
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 Boolean UpdateValue(MqttEventArgs e) {
this.GetFloat = Single.Parse(e.Message, new CultureInfo("en-US"));
return true;
}
}
}