Utils/IoT/JsonSensor/Switch.cs
BlubbFish 29caf6f6f6 [BF] Fixing Senml
[NF] Senml now has a configure option to setup the guid
[NF] Zway-Bot now listen on /exit
[NF] Implment searchpath for Zway-Bot (/etc/zwaybot and %appdata%/zwaybot)
2018-05-07 16:52:24 +00:00

17 lines
551 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<System.String, System.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;
}
}
}