Created PinValueModel.
This commit is contained in:
parent
1ea476ef21
commit
76f8f4a777
14
Proculite.GpioRest/Models/PinValueModel.cs
Normal file
14
Proculite.GpioRest/Models/PinValueModel.cs
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue