diff --git a/Sources/SwiftOCADevice/OCC/ControlClasses/Root.swift b/Sources/SwiftOCADevice/OCC/ControlClasses/Root.swift index 20e361b5..740ba46f 100644 --- a/Sources/SwiftOCADevice/OCC/ControlClasses/Root.swift +++ b/Sources/SwiftOCADevice/OCC/ControlClasses/Root.swift @@ -89,12 +89,10 @@ open class OcaRoot: CustomStringConvertible, Codable, Sendable, _OcaObjectKeyPat lockStateSubject.value } set { - if newValue != lockStateSubject.value { - Task { - try await notifySubscribers(lockState: newValue) - } - } lockStateSubject.value = newValue + Task { + try? await notifySubscribers(lockState: newValue) + } } } diff --git a/Sources/SwiftOCADevice/OCC/PropertyTypes/DeviceProperty.swift b/Sources/SwiftOCADevice/OCC/PropertyTypes/DeviceProperty.swift index 936b1943..84e50237 100644 --- a/Sources/SwiftOCADevice/OCC/PropertyTypes/DeviceProperty.swift +++ b/Sources/SwiftOCADevice/OCC/PropertyTypes/DeviceProperty.swift @@ -273,9 +273,10 @@ public struct OcaDeviceProperty: OcaDevicePropertyRep } set { let property = object[keyPath: storageKeyPath] + property.subject.send(newValue) Task { - await property.setAndNotifySubscribers(object: object, newValue) + try? await property.notifySubscribers(object: object, newValue) } } }