GithubHelp home page GithubHelp logo

Comments (13)

timpur avatar timpur commented on August 28, 2024

@marvinroger @zephyrr @ThomDietrich @euphi @nerdfirefighter @ingoogni @lorenwest @tripflex

from convention.

nicola-lunghi avatar nicola-lunghi commented on August 28, 2024

#76

from convention.

nicola-lunghi avatar nicola-lunghi commented on August 28, 2024

see the other issues that I've created

#77
#78
#79
#80
#81
#82
#83
#84

from convention.

timpur avatar timpur commented on August 28, 2024

Arrays

homie/super-car/$nodes → "lights[]"

homie/super-car/lights/$name → "Lights"
homie/super-car/lights/$properties → "intensity"
homie/super-car/lights/$array → "0-1"

homie/super-car/lights/intensity/$name → "Intensity"
homie/super-car/lights/intensity/$settable → "true"
homie/super-car/lights/intensity/$unit → "%"
homie/super-car/lights/intensity/$datatype → "integer"
homie/super-car/lights/intensity/$format → "0:100"

homie/super-car/lights_0/$name → "Back lights"
homie/super-car/lights_0/intensity → "0"
homie/super-car/lights_1/$name → "Front lights"
homie/super-car/lights_1/intensity → "100"

I was looking at this example and thought to my self, that actually looks complex to subscribe to via mqtt. Wouldnt it be nicer to do this:

homie/super-car/lights/0/$name → "Back lights"
homie/super-car/lights/0/intensity → "0"
homie/super-car/lights/1/$name → "Front lights"
homie/super-car/lights/1/intensity → "100"

Thus you onlt have to sub to homie/super-car/lights/# to get all the node topics, since there all hirarical now.

Maybe also:

homie/super-car/lights/elements/0/$name → "Back lights"
homie/super-car/lights/elements/0/intensity → "0"
homie/super-car/lights/elements/1/$name → "Front lights"
homie/super-car/lights/elements/1/intensity → "100"

Just ideas, tell me your thoughts?

from convention.

marvinroger avatar marvinroger commented on August 28, 2024

homie/super-car/lights/0/$name looks like a $name attribute of the 0 property of the lights node.

from convention.

ThomDietrich avatar ThomDietrich commented on August 28, 2024

My thought exactly.

Remember that the underscore character is reserved for arrays in topic ids. You could benefit from that.

I'd suggest to discuss this in a specific issue.

from convention.

ThomDietrich avatar ThomDietrich commented on August 28, 2024

Also could you create an issue to start discussion of the stats improvement?

from convention.

nerdfirefighter avatar nerdfirefighter commented on August 28, 2024

why is lights an array? is it because now at the nodes layer its by node type?

My usage of a range/array is when i have a light strip where i refer to strip[] which is an array of led 0- length of strip. each led in the strip does not have a name they only have a value (which most of the time is a Red:Green:Blue string). i dont think having an name value for each array element is appropriate. if you need a name is should be its own node not a range.

from convention.

ThomDietrich avatar ThomDietrich commented on August 28, 2024

@nerdfirefighter $name just as most other attributes is not mandatory.

from convention.

timpur avatar timpur commented on August 28, 2024

sorry moved to #90

from convention.

nicola-lunghi avatar nicola-lunghi commented on August 28, 2024

Can we create a "development" or testing branch and start putting the "approved" modification in it to see if this is coherent?
for example the "optional" arguments

from convention.

timpur avatar timpur commented on August 28, 2024

Have you guys seen https://iot.mozilla.org/wot/, @ThomDietrich

from convention.

davidgraeff avatar davidgraeff commented on August 28, 2024

Closing this umbrella issue. See #62.

from convention.

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.