Created PinValueModel.

This commit is contained in:
Filip Strajnar 2024-09-25 19:30:10 +02:00
parent 1ea476ef21
commit 76f8f4a777

View 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;
}
}