#!/usr/bin/env python """ This application creates a Local Schedule Objects and then prompts to test dates and times. """ from time import localtime as _localtime from bacpypes.debugging import bacpypes_debugging, ModuleLogger from bacpypes.consolelogging import ConfigArgumentParser from bacpypes.consolecmd import ConsoleCmd from bacpypes.core import run from bacpypes.primitivedata import Null, Real, Date, Time from bacpypes.constructeddata import ArrayOf, ListOf from bacpypes.basetypes import ( CalendarEntry, DailySchedule, DateRange, DeviceObjectPropertyReference, SpecialEvent, SpecialEventPeriod, TimeValue, ) from bacpypes.object import register_object_type, WritableProperty, AnalogValueObject from bacpypes.app import BIPSimpleApplication from bacpypes.local.device import LocalDeviceObject from bacpypes.local.object import CurrentPropertyListMixIn from bacpypes.local.schedule import LocalScheduleObject # some debugging _debug = 0 _log = ModuleLogger(globals()) # globals test_analog_value = None test_schedule = None @register_object_type(vendor_id=999) class WritableAnalogValueObject(CurrentPropertyListMixIn, AnalogValueObject): properties = [WritableProperty("presentValue", Real)] @bacpypes_debugging def analog_value_changed(old_value, new_value): if _debug: TestConsoleCmd._debug("analog_value_changed %r %r", old_value, new_value) print("analog value changed from {!r} to {!r}".format(old_value, new_value)) @bacpypes_debugging class TestConsoleCmd(ConsoleCmd): def do_test(self, args): """test