File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,9 @@ public extension Ocp1Connection {
138138 subscriptions. removeAll ( )
139139 }
140140
141- internal func refreshSubscriptions ( ) async {
141+ public func addSubscriptions ( events : [ OcaEvent ] ) async {
142142 await withTaskGroup ( of: Void . self, returning: Void . self) { taskGroup in
143- for event in subscriptions . keys {
143+ for event in events {
144144 taskGroup. addTask { [ self ] in
145145 try ? await subscriptionManager. addSubscription (
146146 event: event,
@@ -154,6 +154,10 @@ public extension Ocp1Connection {
154154 }
155155 }
156156
157+ internal func refreshSubscriptions( ) async {
158+ await addSubscriptions ( events: Array ( subscriptions. keys) )
159+ }
160+
157161 internal func notifySubscribers( of event: OcaEvent , with parameters: Data ) {
158162 guard let eventSubscriptions = subscriptions [ event] ,
159163 !eventSubscriptions. subscriptions. isEmpty
You can’t perform that action at this time.
0 commit comments