Skip to content

Commit

Permalink
send push for erd during initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
zivillian committed May 14, 2023
1 parent 296a301 commit 8f30f64
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ism7mqtt/ISM7/Ism7Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,11 @@ private async Task OnPushResponseAsync(IResponse response, CancellationToken can

private async Task LoadInitialValuesAsync(CancellationToken cancellationToken)
{
var visibleDevices = new List<string>();
foreach (var device in _devices.Values)
{
if (!_config.AddDevice(_ipAddress.ToString(), device.Ba)) continue;
visibleDevices.Add(device.Ba);
var infoReads = _config.GetInfoReadForDevice(device.Ba).ToList();
var bundleId = NextBundleId();
_dispatcher.SubscribeOnce(
Expand Down Expand Up @@ -306,6 +308,19 @@ await SendAsync(new TelegramBundleReq
{
await OnInitializationFinishedAsync(_config, cancellationToken);
}
var bn = NextBundleId();
await SendAsync(new TelegramBundleReq
{
AbortOnError = false,
BundleId = bn,
GatewayId = "1",
TelegramBundleType = TelegramBundleType.push,
EStRead = new TelegramBundleReq.ErrorStateRead
{
Seq = bn,
VisibleDeviceAdresses = String.Join(',', visibleDevices)
}
}, cancellationToken);
}

private async Task OnInitialValuesAsync(IResponse response, CancellationToken cancellationToken)
Expand Down

0 comments on commit 8f30f64

Please sign in to comment.