ProjectsOld/Utils/IoT/Sensor/Pir.cs

16 lines
474 B
C#
Raw Normal View History

2017-09-26 20:21:42 +02:00
using System;
using System.Collections.Generic;
2017-10-02 18:32:06 +02:00
using BlubbFish.Utils.IoT.Connector;
2017-09-26 20:21:42 +02:00
2017-10-02 18:32:06 +02:00
namespace BlubbFish.Utils.IoT.Sensor {
2017-09-26 20:21:42 +02:00
class Pir : ASensor {
2017-10-02 00:49:44 +02:00
public Pir(Dictionary<String, String> settings, String name, ADataBackend backend) : base(settings, name, backend) {
2017-09-26 20:21:42 +02:00
this.Datatypes = Types.Bool;
}
2017-10-02 00:49:44 +02:00
protected override Boolean UpdateValue(MqttEventArgs e) {
this.GetBool = (e.Message.ToLower() == "on") ? true : false;
return true;
2017-09-26 20:21:42 +02:00
}
}
}