Git Product home page Git Product logo

Comments (11)

ZeroOne3010 avatar ZeroOne3010 commented on July 24, 2024

Hey, cool! Patches would definitely be welcome. :) Am I guessing right that this is about the new API v2, as the library does not have any support for it yet? I pondered about the implications of changing into API v2 in issue #48, it's not entirely straight forward, but I could probably accept your patch into some branch at least.

I do recommend that you would still try pushing your changes and creating a pull request the normal way. You cannot use your password with the command line anymore, you just need a personal access token as described here: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-authentication-to-github#authenticating-with-the-command-line -- and obviously you cannot push directly into my repository, you need to fork this project to your account first, push the changes there, and then create a pull request from there.

Everything else failing I suppose you could copy & paste your patch to this issue and I could see what I could do with it.

from yetanotherhueapi.

koenraadvds avatar koenraadvds commented on July 24, 2024

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on July 24, 2024

Oh, I see now! When you wrote about "unique id" that immediately got me thinking about the new API version that the Bridge exposes, the API v2, that this library does not support yet. See, in that new API the ids that the various entities have are universally unique, also known as UUIDs, such as "4cf84bbc-312e-4be9-bf6c-601edc6aab46". But yes, you are referring to the ids that the good old API v1 is using, such as "1", "2", etc.

I believe that you must be using version 2.3.0 of the library then, not 3.2. Now, you're in luck, because in version 2.4.0 the ids for both lights and rooms are indeed exposed! :) This was implemented in the context of issue #45. Sensors ids aren't exposed yet, but that can definitely be added. 👍 (Also notice that the most current version is in fact 2.5.0.)

from yetanotherhueapi.

koenraadvds avatar koenraadvds commented on July 24, 2024

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on July 24, 2024

Hello! Yes, sorry, I finally understand what you mean: there is indeed a uniqueId attribute for the lights in API v1! Apparently there always has been, but I've never really paid any attention to it. :o I am inclined to think that it would actually be a disservice for anyone using this library to introduce it now, with API v2 practically just around the corner... There wouldn't really be much time to enjoy it for I do want to convert the library into using API v2 sooner or later.

from yetanotherhueapi.

koenraadvds avatar koenraadvds commented on July 24, 2024

from yetanotherhueapi.

koenraadvds avatar koenraadvds commented on July 24, 2024

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on July 24, 2024

Hi there! Unfortunately no, I must admit I haven't tried the patches... I think the regular ids should be exposed first, not necessarily the unique ids, for that's what has been done with the lights and rooms. Also, I don't know how many versions of this library I will publish before moving on to API v2, at which point the interfaces will need to be changed anyway. I will keep this issue open so that if I can come up with some other feature(s) besides these id accessors, I will remember to add these too into a new version. And hey, it's good that you managed to build your own version! Power of open source software, huh? :)

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on July 24, 2024

@koenraadvds Hi, I've just released a new version of the library, 2.7.0, where you have a new getId() method for Scenes too. Now scenes, rooms, lights and sensors have one. It's still not the unique id you asked for, but it's an id for all of them anyway.

You might also be interested in the api-v2 branch that I've been working on: it is very rudimentary, but you can now use it to toggle lights on and off with the new API. 😅 There, anyway, each resource will have a long UUID.

from yetanotherhueapi.

koenraadvds avatar koenraadvds commented on July 24, 2024

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on July 24, 2024

Version 3.0.0-alpha is now out, and there all the entities are referred to by their UUID. ❤️ I'm just going to go ahead and close this issue, but feel free to still comment here to let me know how that works for you! I'm also looking for any and all feedback on the latest version so that I could eventually promote it to 3.0.0, so opening new issues would be much appreciated too. 🙏 Cheers!

from yetanotherhueapi.

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.