question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Schedule Object not working as expected

See original GitHub issue

Hi, I am creating a bacnet wrapper on top of some bacnet incompatible devices. I would like to control these devices using schedule objects. I created one of them as follows

class TestScheduleObject(ScheduleObject):

    properties = [
        ReadableProperty(
            'effectivePeriod',
            DateRange,
            default=DateRange(startDate="2016-10-14", endDate="2017-10-14")
        ),
        OptionalProperty(
            'weeklySchedule',
            ArrayOf(DailySchedule),
            default=ArrayOf(DailySchedule)([
                DailySchedule(daySchedule=[TimeValue(time="08:46", value=Real(5))]),
                DailySchedule(daySchedule=[TimeValue(time="08:46", value=Real(6))]),
                DailySchedule(daySchedule=[TimeValue(time="08:46", value=Real(7))]),
                DailySchedule(daySchedule=[TimeValue(time="08:46", value=Real(8))]),
                DailySchedule(daySchedule=[TimeValue(time="08:46", value=Real(9))]),
                DailySchedule(daySchedule=[TimeValue(time="08:46", value=Real(10))]),
                DailySchedule(daySchedule=[TimeValue(time="08:46", value=Real(11))])
            ])
        ),
        ReadableProperty(
            'listOfObjectPropertyReferences',
            SequenceOf(DeviceObjectPropertyReference),
            default=SequenceOf(DeviceObjectPropertyReference)([
                DeviceObjectPropertyReference(
                    objectIdentifier=("analogValue", 0),
                    propertyIdentifier="presentValue",
                    propertyArrayIndex=0,
                    deviceIdentifier=("device", 599)
                )
            ])
        ),
        ReadableProperty(
            'outOfService',
            Boolean,
            False
        )
    ]

    def __init__(self, **kwargs):
        if _debug: TestScheduleObject._debug("__init__ %r", kwargs)
        ScheduleObject.__init__(self, **kwargs)

I added the above object as well as the referenced analog-value object to the application; however, the presentValue of the analog-value object is not updated according to the schedule.

Am I missing any parameters to the ScheduleObject, or has the schedule functionality not been implemented as yet?

Thank you.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JoelBendercommented, Nov 11, 2017

In this commit I made AnyAtomic a subclass of Atomic so the sandbox/sample_schedule_object.py works as I want it to. The ReadWriteProperty.py sample application has an additional update so the “value” can be lots of atomic types.

There isn’t any type checking, so the presentValue can be Integer(12) and the scheduleDefault can be Real(13.5).

0reactions
JoelBendercommented, Dec 7, 2017

This has been merged into #144, to be continued.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schedule is not working as expected - Salesforce Developers
My code was running properly until the scheduling user was changed. What does the code do ? The code queries on an object...
Read more >
node.js - schedule.schedulejob is not working as expected
We need to send inactive message to client after 3 days. But somehow the schedulejob is not sending message. Code base: var job...
Read more >
schedule Date object not working · Issue #325 - GitHub
Using schedule() with a Date Object as argument does not work. Scheduled function runs every minute. var date = new Date(Date.now() + 180000); ......
Read more >
Frequently Asked Questions — schedule 1.1.0 documentation
AttributeError : 'module' object has no attribute 'every'. when I try to use schedule. This happens if your code imports the wrong schedule...
Read more >
Schedule not working well on Task Scheduler - Microsoft Q&A
If I go on SAS Enterpirise Guide, open the program and run it manually, everything works. So there is an issue with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found