16 lines
509 B
C#
16 lines
509 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using BlubbFish.Utils.IoT.Connector;
|
|||
|
|
|||
|
namespace BlubbFish.Utils.IoT.Sensor {
|
|||
|
class Switch : ASensor {
|
|||
|
public Switch(Dictionary<System.String, System.String> settings, String name, ADataBackend backend) : base(settings, name, backend) {
|
|||
|
this.Datatypes = Types.Bool;
|
|||
|
}
|
|||
|
|
|||
|
protected override Boolean UpdateValue(MqttEventArgs e) {
|
|||
|
this.GetBool = (e.Message.ToLower() == "on") ? true : false;
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|