using System;
using System.Threading.Tasks;
using TINK.Services.BluetoothLock.Tdo;
namespace TINK.Services.BluetoothLock
{
///
/// Represents a not exisitng lock.
///
public class NullLock : ILockService
{
private int BikeId { get; }
public NullLock(int bikeId)
{
BikeId = bikeId;
}
public Task ReconnectAsync(LockInfoAuthTdo authInfo, TimeSpan connectTimeout) =>
throw new NotImplementedException();
public string Name =>
throw new NotImplementedException();
public Guid Guid =>
throw new NotImplementedException();
public int Id =>
throw new NotImplementedException();
public async Task OpenAsync() =>
await Task.FromResult((LockitLockingState?)null);
public async Task CloseAsync() =>
await Task.FromResult((LockitLockingState?)null);
public Task GetBatteryPercentageAsync() =>
throw new System.Exception($"Can not get battery percentage. Lock {BikeId} not found.");
public DeviceState? GetDeviceState() =>
throw new NotImplementedException();
public Task GetIsAlarmOffAsync() =>
throw new System.Exception($"Can not get whether alarm is on or off. Lock {BikeId} not found.");
public Task GetLockStateAsync(bool doWaitRetry = false) =>
throw new NotImplementedException();
public Task SetIsAlarmOffAsync(bool isActivated) =>
throw new System.Exception($"Can not set alarm {isActivated}. Lock {BikeId} not found.");
public async Task SetSoundAsync(SoundSettings settings) =>
await Task.FromResult(false);
/// Disconnect from bluetooth lock.
public Task Disconnect() =>
throw new NotImplementedException();
}
}