mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.370
This commit is contained in:
parent
f5cf9bb22f
commit
bdb2dec1c1
233 changed files with 10252 additions and 6779 deletions
|
@ -128,13 +128,23 @@ namespace TINK.Repository.Request
|
|||
/// <summary> Copri locking states</summary>
|
||||
public enum lock_state
|
||||
{
|
||||
/// <summary> Request to backend to close lock in context of pausing ride.</summary>
|
||||
locking,
|
||||
|
||||
/// <summary> Lock is closed.</summary>
|
||||
locked,
|
||||
|
||||
/// <summary> Request to backend to close lock either in context of resuming ride or starting a rental.</summary>
|
||||
unlocking,
|
||||
|
||||
/// <summary> Lock is open.</summary>
|
||||
unlocked,
|
||||
|
||||
/// <summary> Lock is unknown state.</summary>
|
||||
unspecific,
|
||||
}
|
||||
|
||||
/// <summary> Holds lockation info.</summary>
|
||||
/// <summary> Holds location info.</summary>
|
||||
public class LocationDto
|
||||
{
|
||||
public double Latitude { get; private set; }
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace TINK.Repository.Request
|
|||
}
|
||||
|
||||
/// <summary> Gets the smart device parameters. </summary>
|
||||
/// <returns>in a format which is urlencode invariant.</returns>
|
||||
/// <returns>in a format which is url encode invariant.</returns>
|
||||
public static string GetSmartDeviceParameters(this ISmartDevice smartDevice)
|
||||
=> smartDevice != null
|
||||
? $"{(!string.IsNullOrEmpty(smartDevice.Manufacturer) ? $"&user_device_manufacturer={WebUtility.UrlEncode(smartDevice.Manufacturer)}" : string.Empty)}" +
|
||||
|
@ -42,5 +42,28 @@ namespace TINK.Repository.Request
|
|||
$"{(!string.IsNullOrEmpty(smartDevice.VersionText) ? $"&user_device_version={WebUtility.UrlEncode(smartDevice.VersionText)}" : string.Empty)}" +
|
||||
$"{(!string.IsNullOrEmpty(smartDevice.Identifier) ? $"&user_device_id={WebUtility.UrlEncode(smartDevice.Identifier)}" : string.Empty)}"
|
||||
: string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Converts from one locking state enum to another.
|
||||
/// </summary>
|
||||
/// <param name="state">Locking state to convert.</param>
|
||||
/// <returns>Target state.</returns>
|
||||
public static lock_state? GetLockState(this Model.Bikes.BikeInfoNS.BluetoothLock.LockingState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case Model.Bikes.BikeInfoNS.BluetoothLock.LockingState.Open:
|
||||
return lock_state.unlocked;
|
||||
|
||||
case Model.Bikes.BikeInfoNS.BluetoothLock.LockingState.Closed:
|
||||
return lock_state.locked;
|
||||
|
||||
case Model.Bikes.BikeInfoNS.BluetoothLock.LockingState.UnknownFromHardwareError:
|
||||
return lock_state.unspecific;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue