Innovenergy_trunk/csharp/app/GuiFeeder/Utils.cs

21 lines
473 B
C#

using System.Reactive.Linq;
using InnovEnergy.Lib.Protocols.DBus;
using InnovEnergy.Lib.Victron.VeDBus;
namespace InnovEnergy.GuiFeeder;
public static class Utils
{
public static IObservable<IReadOnlyList<ServiceProperties>> ObserveVeService(this DBusConnection dbus,
Func<String, Boolean> selector)
{
return dbus
.ObservePropertiesOfServices(selector)
.StartWith(Array.Empty<ServiceProperties>());
}
}