1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00
Go to file
Christian Tremblay, ing e38c27ecd4 Decorators is an effort to handle object creation without explicitly declare a new class
depending on the properties or features required.

# Usage

## bacnet_properties
This decorator takes a dict as argument defining supplmental properties

## bacnet_property
This decorator takes a simple property and its default value, adds it to object

## Commandable
This decoratore will modify the base class and create a new class that inherit from _commando (see local.object.py)

## Add feature
This decorator works the same than commandable. Could serve as a way to add behaviour like MinOnOff, events, limits, etc...

## Example::

    properties = {"outOfService" : False,
                "relinquishDefault" : 0,
                "units": "degreesCelsius",
                "highLimit": 98}

    @bacnet_properties(properties)
    @commandable()
    def av(instance, objectName, presentValue, description):
        OBJECT_TYPE = AnalogValueObject
        return create(OBJECT_TYPE,instance, objectName, presentValue, description)

    @add_feature(MinOnOff)
    @commandable()
    def bv(instance, objectName, presentValue, description):
        OBJECT_TYPE = BinaryValueObject
        return create(OBJECT_TYPE,instance, objectName, presentValue, description)

    @commandable()
    def datepattern(instance, objectName, presentValue, description):
        OBJECT_TYPE = DatePatternValueObject
        return create(OBJECT_TYPE,instance, objectName, presentValue, description)

    ### The creation takes place when the functions are called
    a = av(1,'AnalogValueName',10,'AnalogValue Description')
    b = bv(1,'BV Name','inactive','BinaryValue Description')
    c = datepattern(1,'My Date Pattern',None,'DatePattern Description')

Signed-off-by: Christian Tremblay, ing. <christian.tremblay@servisys.com>
2020-07-31 16:53:07 -04:00
doc 0.17.6 released 2019-04-19 10:04:42 -04:00
pcap_tools initial commit 2015-07-15 16:51:27 -04:00
py25/bacpypes stage merged and conflicts resolved 2020-04-22 18:51:14 -04:00
py27/bacpypes stage merged and conflicts resolved 2020-04-22 18:51:14 -04:00
py34/bacpypes Decorators is an effort to handle object creation without explicitly declare a new class 2020-07-31 16:53:07 -04:00
samples stage merged and conflicts resolved 2020-04-22 18:51:14 -04:00
sandbox 0.18.0 releasd 2020-01-29 15:46:08 -05:00
tests Decorators is an effort to handle object creation without explicitly declare a new class 2020-07-31 16:53:07 -04:00
.gitignore first commit, introduced DeviceCommunicationControlServices class 2017-08-03 18:17:41 +05:30
BACpypes~.ini use the other parameter, when=0 means something different than delta=0 (but probably shouldn't) 2017-12-15 10:59:38 -05:00
BACpypes~.json release 0.17.7 2019-11-17 14:57:47 -05:00
check_install.sh stage merged and conflicts resolved 2020-04-22 18:51:14 -04:00
LICENSE Initial commit 2015-07-15 16:33:51 -04:00
README.md Added documentation badge 2016-11-15 22:34:37 -05:00
README.txt remove universal flag from setup, add a sdist build to the script 2015-08-14 19:45:12 -04:00
release_to_pypi.sh update release script and classifiers 2020-01-29 15:53:34 -05:00
requirements.txt initial commit 2015-07-15 16:51:27 -04:00
setup.cfg use recommended format for configuration 2016-08-23 16:14:40 -04:00
setup.py update release script and classifiers 2020-01-29 15:53:34 -05:00
test_script.sh release 0.17.7 2019-11-17 14:57:47 -05:00
tox.ini convert tests from nose to pytest 2016-05-07 15:53:58 -04:00

BACpypes

BACpypes provides a BACnet application layer and network layer written in Python for daemons, scripting, and graphical interfaces. This is the current project, not the one over on SourceForge.

Join the chat at https://gitter.im/JoelBender/bacpypes

Documentation Status