Utils/IoT/JsonSensor/Pir.cs

17 lines
531 B
C#
Raw Normal View History

2017-10-02 18:26:38 +02:00
using System;
using System.Collections.Generic;
using BlubbFish.Utils.IoT.Connector;
using BlubbFish.Utils.IoT.Events;
2017-10-02 18:26:38 +02:00
namespace BlubbFish.Utils.IoT.JsonSensor {
class Pir : AJsonSensor {
2017-10-02 18:26:38 +02:00
public Pir(Dictionary<String, String> settings, String name, ADataBackend backend) : base(settings, name, backend) {
this.Datatypes = Types.Bool;
}
protected override Boolean UpdateValue(BackendEvent e) {
2017-10-02 18:26:38 +02:00
this.GetBool = (e.Message.ToLower() == "on") ? true : false;
return true;
}
}
}