Giter VIP home page Giter VIP logo

Comments (13)

uzi18 avatar uzi18 commented on July 22, 2024

So for realy generic - template per sensortype feature is also needed.

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

sounds good krikk:)

from espeasy.

krikk avatar krikk commented on July 22, 2024

TODO: an option to send all the values in one http request?

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

that last pull request is pretty good. now we can send multiple values in one call, and prevent needing a new controller for things like the nettemp one.

i did a bit of cleaning up and added it to testing.

a few notes for improvements:

  • the big complex whileloops that delete unused variables should just call a generic function, like this: void DeleteVarIndex(String &s, byte varindex).

In case of SENSOR_TYPE_SINGLE you can then just call:
DeleteVarIndex(s, 2);
DeleteVarIndex(s, 3);
DeleteVarIndex(s, 4);

  • handling of special stuff like SENSOR_TYPE_LONG should also be done in ReplaceTokenByValue(). That way we can remove the whole switch-statement in "case CPLUGIN_PROTOCOL_SEND:" and simply call HTTPSend011().

In the future we then can also add more complex stuff like wind-direction strings.

After that there is more room for little improvements, making the code even smaller and better maintainable. :)

thanks for all the hard work!

from espeasy.

uzi18 avatar uzi18 commented on July 22, 2024

OK, need to add also custom server key:
&key=SomeKey
and actual esp-ip-address:
&ip=1.1.1.1

for gpio have different template - will be possible to store it as different Controller?

Maybe it is good idea to hardcode some tamplates in HTTP Generic Advenced - to easy choose from?

from espeasy.

krikk avatar krikk commented on July 22, 2024

the key should be no problem you can add what ever text you want... the ip is also possible with %ip% after my newest pull requst is merged...

from espeasy.

uzi18 avatar uzi18 commented on July 22, 2024

from espeasy.

krikk avatar krikk commented on July 22, 2024

in a first step i will be simplier to collect this templates on the wiki...

from espeasy.

psy0rz avatar psy0rz commented on July 22, 2024

indeed. later i want to make a piece of javascript that dynamicly loads the templates from github. so we can add templates on the fly without needing new and bigger firmware.

i'm doing a similar thing for my ledanim project. works great.

from espeasy.

uzi18 avatar uzi18 commented on July 22, 2024

@psy0rz nice project :)

from espeasy.

deejaybeam avatar deejaybeam commented on July 22, 2024

would be nice to add a "PATCH" method to HTTP Generic advanced

from espeasy.

krikk avatar krikk commented on July 22, 2024

PATCH method?

from espeasy.

deejaybeam avatar deejaybeam commented on July 22, 2024

@krikk Yes! Currently supported is GET,POST,PUT and HEAD - to update variables in pimatic via restAPI PATCH is needed

from espeasy.

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.