private bool RtSetValue(SetValueParam[] toSets) { if (toSets.Any(t => RtTagExpression.IsExpression(t.Topic))) { return(false); } logger.LogInformation("RtSetValue {@toSets}", System.Text.Json.JsonSerializer.Serialize(toSets)); return(toSets.All(t => { if (t.Value.ValueKind == JsonValueKind.Number) { return connector.SetNumeric(t.Topic, t.Value.GetDouble()); } else if (t.Value.ValueKind == JsonValueKind.Array || t.Value.ValueKind == JsonValueKind.Object) { return connector.SetJson(t.Topic, t.Value); } else { return connector.SetText(t.Topic, t.Value.ToString()); } })); }
private void ShiftScopedPublishShiftCrew(object sender, ShiftCrewDto shiftCrew) { logger.LogInformation("PublishShiftCrew {@shiftCrew}", shiftCrew); var profile = GetShiftProfile(shiftCrew.NameShiftProfile); if (profile != null && connector != null && !string.IsNullOrWhiteSpace(profile.TagPublish)) { connector.SetJson(profile.TagPublish, shiftCrew); } PublishShiftCrew?.Invoke(this, shiftCrew); notification?.OnUpdateShiftCrew(shiftCrew); }