2017-10-02 18:26:38 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using BlubbFish.Utils.IoT.Connector;
|
2018-05-07 18:52:24 +02:00
|
|
|
|
using BlubbFish.Utils.IoT.Events;
|
2017-10-02 18:26:38 +02:00
|
|
|
|
|
2018-05-07 18:52:24 +02:00
|
|
|
|
namespace BlubbFish.Utils.IoT.JsonSensor {
|
|
|
|
|
class Luminanz : AJsonSensor {
|
2017-10-02 18:26:38 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-07 18:52:24 +02:00
|
|
|
|
protected override Boolean UpdateValue(BackendEvent e) {
|
2017-10-02 18:26:38 +02:00
|
|
|
|
this.GetInt = Int32.Parse(e.Message, new CultureInfo("en-US"));
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|