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
using (var connectionManager = new BluetoothLEConnectionManager()) | |
{ | |
var connectionA = await connectionManager.FindConnectionById("BluetoothLE#BluetoothLEb8:31:b5:93:3c:8c-90:84:2b:4d:d2:62"); | |
var connectionB = await connectionManager.FindConnectionById("BluetoothLE#BluetoothLEb8:31:b5:93:3c:8c-90:84:2b:4e:1b:dd"); | |
var hubA = new TechnicSmartHub(connectionA); | |
var hubB = new TechnicSmartHub(connectionB); | |
// wait until connected | |
await hubA.Connect(); |
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
mutation CreateHumanNodeType { | |
createNodeType(name: "Human") { | |
id | |
} | |
} |
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
private EntityModelData TransformEntity(EntityModelData entityModel, IDictionary<string, string> claims) | |
{ | |
var json = JsonConvert.SerializeObject(entityModel); | |
var regex = new Regex(@"{{([^|}]*)(?:[|]([^}]*))?}}"); | |
var matches = regex.Matches(json); | |
foreach(Match match in matches) | |
{ | |
var key = match.Groups[1].Value; |
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
"ExtensionData": { | |
"TargetGroupConditions": { | |
"$type": "Condition[]", | |
"$values": [ | |
{ | |
"$type": "CustomerCharacteristicCondition", | |
"Name": "user.givenName", | |
"Operator": 4, | |
"Value": "John", | |
"Negate": false |
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
private List<EntityModelData> EvaluateEntities(List<EntityModelData> entityModels, IDictionary<string, string> claims) | |
{ | |
var entities = new List<EntityModelData>(); | |
if(entityModels != null) | |
{ | |
foreach (var entityModel in entityModels) | |
{ | |
var evaluation = true; |
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
private List<RegionModelData> EvaluateRegions(List<RegionModelData> regionModelSet, IDictionary<string, string> claims) | |
{ | |
var evaluated = new List<RegionModelData>(); | |
if(regionModelSet != null) | |
{ | |
foreach (var regionModel in regionModelSet) | |
{ | |
var entities = EvaluateEntities(regionModel.Entities, claims); | |
var regions = EvaluateRegions(regionModel.Regions, claims); |