From 5ce45a45b78e81eaa26683d967900f7af44b9c70 Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Tue, 27 Jul 2021 01:38:56 -0400 Subject: [PATCH] add the mixin outline --- py34/bacpypes/local/object.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/py34/bacpypes/local/object.py b/py34/bacpypes/local/object.py index af7ff272..2a6ce046 100644 --- a/py34/bacpypes/local/object.py +++ b/py34/bacpypes/local/object.py @@ -80,6 +80,36 @@ class CurrentPropertyListMixIn(Object): CurrentPropertyList(), ] +# +# WriteableObjectName +# + +@bacpypes_debugging +class WriteableObjectName(WritableProperty): + + def __init__(self): + if _debug: WriteableObjectName._debug("__init__") + WritableProperty.__init__(self, 'objectName', CharacterString, default=None, optional=False) + + def WriteProperty(self, obj, value, arrayIndex=None, priority=None, direct=False): + if _debug: + WritableProperty._debug( + "WriteProperty %r %r arrayIndex=%r priority=%r direct=%r", + obj, value, arrayIndex, priority, direct, + ) + raise ExecutionError(errorClass='property', errorCode='writeAccessDenied') + +# +# WriteableObjectNameMixIn +# + +@bacpypes_debugging +class WriteableObjectNameMixIn(Object): + + properties = [ + WriteableObjectName(), + ] + # # Turtle Reference Patterns #