Giter Club home page Giter Club logo

Comments (5)

benfrancis avatar benfrancis commented on July 21, 2024

@dhylands Have you started working on anything like this yet by any chance? I need this for the next step on the front end, to actually turn the on/off switches on and off :)

from gateway.

benfrancis avatar benfrancis commented on July 21, 2024

Looking through the code of the DebugController it looks like I could create a PropertyController with a PUT handler that looks something like this...

  var device = adapterManager.getDevice(deviceId);
  if (device) {
    var attribute = device.getAttribute(attributeId);
    if (attribute) {
      var attributeValue = request.body[attributeId];
      if (attributeValue !== undefined) {
        device.setAttributeValue(attributeId, attributeValue);
        response.send();
        return;
      }

Should I do that, or do you think we should add a method on the adapter manager? Really I guess the adapter should be translating WebThing property names into Z-Wave device attribute names.

from gateway.

dhylands avatar dhylands commented on July 21, 2024

Yeah - I think that the adapter manager should be creating WebThing property names, and then those should be used to create the REST API.

So it would be very similar to what you have above, although I'd probably use 'Property' rather than 'Attribute' if we're going to generate WebThing properties.

from gateway.

benfrancis avatar benfrancis commented on July 21, 2024

OK, well if there was a method on AdapterManager where I could just call AdapterManager.setProperty(deviceId, propertyName, value) with the Web Thing property name, that would be awesome :)

from gateway.

benfrancis avatar benfrancis commented on July 21, 2024

Implemented

from gateway.

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.