Files
Utils-IoT/Utils-IoT/JsonSensor/Switch.cs
T
2019-11-24 20:12:35 +01:00

15 lines
510 B
C#

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