mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-23 15:46:29 +01:00
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using System;
|
|
using TINK.Model.Bikes.Bike.CopriLock;
|
|
|
|
namespace TINK.Model.Bike.CopriLock
|
|
{
|
|
public class LockInfoMutable : ILockInfoMutable
|
|
{
|
|
/// <summary> Lock info object. </summary>
|
|
private LockInfo LockInfo { get; set; }
|
|
|
|
/// <summary> Constructs a bluetooth lock info object. </summary>
|
|
/// <param name="id">Id of lock must always been known when constructing an lock info object.</param>
|
|
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();
|
|
}
|
|
|
|
/// <summary> Holds the percentage of lock battery.</summary>
|
|
public double BatteryPercentage { get; set; } = double.NaN;
|
|
|
|
/// <summary> Loads lock info object from values. </summary>
|
|
public void Load()
|
|
{
|
|
LockInfo = new LockInfo.Builder(LockInfo) { }.Build();
|
|
}
|
|
}
|
|
}
|