diff --git a/Proculite.GpioRest/Models/PinValueModel.cs b/Proculite.GpioRest/Models/PinValueModel.cs new file mode 100644 index 0000000..1767b67 --- /dev/null +++ b/Proculite.GpioRest/Models/PinValueModel.cs @@ -0,0 +1,14 @@ +using System.Device.Gpio; +using System.Text.Json.Serialization; + +namespace Proculite.GpioRest.Models +{ + public class PinValueModel(int pinNumber, PinValue pinValue) + { + public int PinNumber { get; set; } = pinNumber; + + [JsonIgnore] + public PinValue PinValue { get; set; } = pinValue; + public int Value => PinValue == PinValue.High ? 1 : 0; + } +}