15 lines
459 B
C#
15 lines
459 B
C#
|
using InnovEnergy.Lib.Devices.EmuMeter;
|
||
|
using InnovEnergy.Lib.Protocols.DBus.Protocol.DataTypes;
|
||
|
using InnovEnergy.Lib.Victron.VeDBus;
|
||
|
|
||
|
namespace InnovEnergy.EmuMeter;
|
||
|
|
||
|
public record Signal(Func<EmuMeterStatus, Object> Source, ObjectPath Path, String Format = "")
|
||
|
{
|
||
|
public VeProperty ToVeProperty(EmuMeterStatus status)
|
||
|
{
|
||
|
var value = Source(status);
|
||
|
return new VeProperty(Path, value, String.Format($"{{0:{Format}}}", value));
|
||
|
}
|
||
|
|
||
|
}
|