From 9c752b3347d30c1bf64b98dca8d9d54000491b4a Mon Sep 17 00:00:00 2001 From: zivillian Date: Sun, 14 May 2023 20:43:31 +0200 Subject: [PATCH] send push for erd during initialization --- src/ism7mqtt/ISM7/Ism7Client.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ism7mqtt/ISM7/Ism7Client.cs b/src/ism7mqtt/ISM7/Ism7Client.cs index 298c7be..412ac70 100644 --- a/src/ism7mqtt/ISM7/Ism7Client.cs +++ b/src/ism7mqtt/ISM7/Ism7Client.cs @@ -276,9 +276,11 @@ private async Task OnPushResponseAsync(IResponse response, CancellationToken can private async Task LoadInitialValuesAsync(CancellationToken cancellationToken) { + var visibleDevices = new List(); 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( @@ -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)