Code Monkey home page Code Monkey logo

Comments (13)

skydiver avatar skydiver commented on May 28, 2024 1

Docs where updated.

Thanks @ttz642 for your feedback.

from ewelink-api.

ttz642 avatar ttz642 commented on May 28, 2024 1

I'm in south america, the app works instantaneously, but the API takes up to 15-20 secs to toggle on/off any device. Im using the correct region. Also, i tried with other regions, and no better results... any advice to get lower delay?

Do you log in each time or have you got an application running which only logs in once?

from ewelink-api.

ttz642 avatar ttz642 commented on May 28, 2024 1

I've split my application into services that run constantly and thus only connect once, or reconnect on error.

www - operator interface to control panel to show/change state of devices & edit switching table
events - captures events from the devices (via the cloud at the moment, looking to implement over LAN)
lanSwitcher - process to change device state
scheduler - changes device state according to the switching table which has state of devices over complete day in 5 min slots

I use REST (ie web services) to send messages between services.

Might package up one day and upload to github when I get the time.

interface to control panel to show/change state of devices
Screenshot at 2020-06-09 14-57-14

edit switching table
Screenshot at 2020-06-09 14-56-22

service logs
Screenshot at 2020-06-09 14-57-51

from ewelink-api.

skydiver avatar skydiver commented on May 28, 2024

Hello @ttz642

You're right, by default is connecting to us server, and finding your right region and switching in case of an error, that's why the delay.

So, first thing is to update documentation to specific you need to set your region and leave empty in case of not knowing.

I never had troubles like people are reporting on #21, probably because i'm on us region.

Conclusion, you need to set region ever, specially if you're connecting with api key and token.


The second part, the lan mode.

There are a couple of PRs open for this feature, but the original author didn't respond on the last weeks.

I will try to push this changes to include on next weeks.

from ewelink-api.

ttz642 avatar ttz642 commented on May 28, 2024

Martin,

The second part, the lan mode.
There are a couple of PRs open for this feature, but the original author didn't respond on the last weeks.
I will try to push this changes to include on next weeks.

I will test / debug . . .

--
Steve

from ewelink-api.

skydiver avatar skydiver commented on May 28, 2024

Hello @ttz642

Docs where updated, here are the list of pages who have changed:

  • quickstart
  • class-instantiation
  • demos/node
  • demos/serverless

Would be great if you can take a look and let me know if i missed something.

Thanks.-

from ewelink-api.

ttz642 avatar ttz642 commented on May 28, 2024

Martin,

  • quickstart
  • class-instantiation

For consistency could you change quickstart to use connection as all other sections of the documentation use rather then being different and using conn?

Also could you add the warning you have in:

  • class-instantiation
  • demos/serverless
    to:
  • quickstart
  • demos/node

Also perhaps change the demos/serverless examples to use the region returned from the login for the subsequent access using accesstoken and apikey, ie:

  • const region = login.region;

Otherwise looks good.

--
Steve

from ewelink-api.

ttz642 avatar ttz642 commented on May 28, 2024

Martin,

Docs where updated.

One last minor suggestion, perhaps add:

console.log('region: ', login.region);

to the login method so it's the same as the serverless demo.

from ewelink-api.

doganbulut avatar doganbulut commented on May 28, 2024

Hi,
I am using ewelink-api.
I've used the toggle function five times in a row.
It works between five and six seconds. Is this normal ?

ok1 Fri Jan 03 2020 21:52:52 GMT+0300 (GMT+03:00)
ok2 Fri Jan 03 2020 21:52:56 GMT+0300 (GMT+03:00)
ok3 Fri Jan 03 2020 21:53:01 GMT+0300 (GMT+03:00)
ok4 Fri Jan 03 2020 21:53:05 GMT+0300 (GMT+03:00)
ok5 Fri Jan 03 2020 21:53:10 GMT+0300 (GMT+03:00)

case1

from ewelink-api.

ttz642 avatar ttz642 commented on May 28, 2024

Hi,
I am using ewelink-api.
I've used the toggle function five times in a row.
It works between five and six seconds. Is this normal ?

I experienced it at ~ 6s and got it down to ~ 2s. I think there are some tweaks needed for the performance of the code.

doganbulut what region are you in, are you using the correct one? See issue #53

I'm guessing GMT+3 you should be using eu, see what gets returned. Call class instantiation with no region and the getCredentials, see: https://ewelink-api.now.sh/docs/class-instantiation

After migrating to the 2.0 code I might have a look seeing where the bottlenecks are.

from ewelink-api.

jmarfia avatar jmarfia commented on May 28, 2024

I'm in south america, the app works instantaneously, but the API takes up to 15-20 secs to toggle on/off any device. Im using the correct region. Also, i tried with other regions, and no better results... any advice to get lower delay?

from ewelink-api.

jmarfia avatar jmarfia commented on May 28, 2024

I'm in south america, the app works instantaneously, but the API takes up to 15-20 secs to toggle on/off any device. Im using the correct region. Also, i tried with other regions, and no better results... any advice to get lower delay?

Do you log in each time or have you got an application running which only logs in once?

I login each time. How can i let the session open?

from ewelink-api.

skydiver avatar skydiver commented on May 28, 2024

Hey @jmarfia

You can try to get your access token and api key and use instead of login with user/pass all the time.

First, get your credentials: https://github.com/skydiver/ewelink-api/blob/master/docs/available-methods/getcredentials.md

Initialize the class using at and apiKey: https://github.com/skydiver/ewelink-api/blob/master/docs/class-instantiation.md

Get your device as usual: https://github.com/skydiver/ewelink-api/blob/master/docs/available-methods/getdevice.md

from ewelink-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.