namespace TINK.Model.Bikes.BikeInfoNS.CopriLock
{
public class LockInfoMutable : ILockInfoMutable
{
/// Lock info object.
private LockInfo LockInfo { get; set; }
/// Constructs a bluetooth lock info object.
/// Id of lock must always been known when constructing an lock info object.
public LockInfoMutable(LockingState state)
{
LockInfo = new LockInfo.Builder() { State = state }.Build();
}
public LockingState State
{
get => LockInfo.State;
set => LockInfo = new LockInfo.Builder(LockInfo) { State = value }.Build();
}
/// Holds the percentage of lock battery.
public double BatteryPercentage { get; set; } = double.NaN;
/// Loads lock info object from values.
public void Load()
{
LockInfo = new LockInfo.Builder(LockInfo) { }.Build();
}
}
}