• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Input State remains the same

    Official EVOK API
    neuron pi l203 evok api input
    2
    2
    1474
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      HarishKumar last edited by

      I made some changes to the API according to my requirements, I am able to control the relays the ways I wanted but when I check the input state using the command result = map(lambda dev: dev.full(), Devices.by_int(INPUT)) which I'm running it in a while loop but when the state of the input changes outside the result displayed doesn't change at all. It stays the same, but when I run it in the LoadAllHandler function, the state change is visible. It would be great if you guys could tell me where I'm going wrong.

      T 1 Reply Last reply Reply Quote 0
      • T
        tomas_hora administrators @HarishKumar last edited by

        @HarishKumar
        The evok itself is not designed to handle the logic of your application. That's why we call it API.

        It is using Tornado which means the server itself runs in one loop so you need to have all the program behavior ready before it is called mainLoop.start(). So if you run an infinite loop anywhere in evok, you stop everything else (reading, setting, all APIs, ...).

        So I suggest using that APIs, it is much more easier to implement and you have the same functionality. But if you would REALLY want to do it in evok, you would have to prepare your program in a function, all tasks that would take more time would have to be decorated as coroutines and the call has to be yielded in order not to stop the main loop. The logic behind this is a little bit complicated to describe in one post :)

        1 Reply Last reply Reply Quote 0
        • First post
          Last post