sharee.bike-App/LockItShared/Services/BluetoothLock/NullLock.cs
2022-09-20 13:51:55 +02:00

70 lines
2.1 KiB
C#

using System;
using System.Threading.Tasks;
using TINK.Services.BluetoothLock.Tdo;
namespace TINK.Services.BluetoothLock
{
/// <summary>
/// Represents a not exisitng lock.
/// </summary>
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<LockitLockingState?> OpenAsync() =>
await Task.FromResult((LockitLockingState?)null);
public async Task<LockitLockingState?> CloseAsync() =>
await Task.FromResult((LockitLockingState?)null);
public Task<double> GetBatteryPercentageAsync() =>
throw new System.Exception($"Can not get battery percentage. Lock {BikeId} not found.");
public Task<VersionInfoTdo> GetVersionInfoAsync() =>
throw new System.Exception($"Can not get versions. Lock {BikeId} not found.");
public VersionInfoTdo VersionInfo
{
get => throw new System.Exception($"Can not get versions. Lock {BikeId} not found.");
}
public DeviceState? GetDeviceState() =>
throw new NotImplementedException();
public Task<bool> GetIsAlarmOffAsync() =>
throw new System.Exception($"Can not get whether alarm is on or off. Lock {BikeId} not found.");
public Task<LockInfoTdo> 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<bool> SetSoundAsync(SoundSettings settings) =>
await Task.FromResult(false);
public async Task<bool> SetAlarmSettingsAsync(AlarmSettings settings) =>
await Task.FromResult(false);
/// <summary> Disconnect from bluetooth lock. </summary>
public Task Disconnect() =>
throw new NotImplementedException();
}
}