Giter VIP home page Giter VIP logo

Comments (16)

tim-hellhake avatar tim-hellhake commented on August 26, 2024 2

Currently, it's only possible to use the HTTP requests as an action.
If I understand you correctly you want to use the result of the request as a property?

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024 1

So thanks for the work bow

I'm always happy if I can help :)

The latest idea I had in mind was my reMarkable

I wasn't aware that you can control it wirelessly.
Sounds pretty cool!

I believe JSON, string, float and int should cover most cases.

I added support for primitive types yesterday.
JSON needs some additional work as I need to extract the values somehow.

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024 1

As soon as the PR is merged you can test the new update.

Which just happened 😬

from http-adapter.

Utopiah avatar Utopiah commented on August 26, 2024 1

Because a picture is worth 1000 words :D

image

from http-adapter.

ErfanDL avatar ErfanDL commented on August 26, 2024

Currently, it's only possible to use the HTTP requests as an action.
If I understand you correctly you want to use the result of the request as a property?

thanks for reply. yes I want to reading the result of the request.

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

Sorry, I missed your response.

I want to reading the result of the request

That's not possible with the current implementation.
Actions don't have a result.
I think I could expose an HTTP endpoint as a device property, but that would be limited to primitive types like string or number.
You would need to specify which value you would like to use.
Are you still interested in this?

from http-adapter.

Utopiah avatar Utopiah commented on August 26, 2024

Hi, I'm interested in this. I'd like to show the properties of a device in addition to actions.
It could be either as result of an action, e.g. read sensor value, but ideally would follow the Thing model and displayed without user input.

PS: Thanks for the plugin by the way, I was able to connect and control my Roomba with it, cf https://twitter.com/utopiah/status/1322236808600735744

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

Hi @Utopiah,

I already did some testing with simple types but I never pushed it.
What type of responses do you have?
Nice tweets btw 😬

from http-adapter.

Utopiah avatar Utopiah commented on August 26, 2024

Thanks @tim-hellhake, there would be no nice tweets without this amazing add-on! So thanks for the work 🙇

The latest idea I had in mind was my reMarkable for its battery level (since I stuck it on my fridge) in order to have rules related to notifications or my scale to... well maybe lock the fridge 😉

For those two I either rely on a REST API (e.g. koalazak/rest980) or I setup a small express server when there is nothing (e.g. reMarkable) so I usually have control but I believe JSON, string, float and int should cover most cases.

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

As soon as the PR is merged you can test the new update.
I'll add support for JSON soon.

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

I added an option to specify device capabilities (https://iot.mozilla.org/schemas).
If you add the MultiLevelSensor capability to the device and the LevelProperty type to the battery property, you should be able to see the battery level in the things view.

from http-adapter.

Utopiah avatar Utopiah commented on August 26, 2024

Super!

image

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

One thing is bothering me.
The battery should be read-only.
I need to add a new config option for that.

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

After the next update, the battery property should look a bit different.
You also set the unit in the settings for % now.

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

If you select the right capability for the device, you should see the value instead of THING.
Just click on edit and select the Multi Level Sensor.
image
image

from http-adapter.

tim-hellhake avatar tim-hellhake commented on August 26, 2024

@Utopiah I'm closing this now.
If you have any problems just open a new PR :)

from http-adapter.

Related Issues (4)

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.