ProjectsOld/IoT-Bot/IoT-Bot/Sensor/Luminanz.cs

21 lines
567 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using IoTBot.Connector;
namespace IoTBot.Sensor {
class Luminanz : ASensor {
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 Boolean UpdateValue(MqttEventArgs e) {
this.GetInt = Int32.Parse(e.Message, new CultureInfo("en-US"));
return true;
}
}
}