This repository has been archived by the owner on May 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ring Blink on LockAction in progress
Ring is closed when locked
- Loading branch information
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.UI.Xaml.Data; | ||
using Nuki.Communication.API; | ||
|
||
namespace Nuki.Converter | ||
{ | ||
public class LockStateConverter : IValueConverter | ||
{ | ||
public NukiLockState LockState { get; set; } | ||
public bool Inverted { get; set; } | ||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
bool blnRet = false; | ||
NukiLockState state; | ||
if (Enum.TryParse<NukiLockState>(value?.ToString(), out state)) | ||
{ | ||
blnRet = state == LockState; | ||
|
||
} | ||
else { } | ||
|
||
if (Inverted) | ||
blnRet = !blnRet; | ||
return blnRet; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters