Git Product home page Git Product logo

Comments (10)

ZeroOne3010 avatar ZeroOne3010 commented on June 26, 2024

Cool, thanks for your message! The library has been developed based on my own needs, and until now I have not needed alerts, so it's not there yet. It's a good idea, though! I'll have to see how it would work out. πŸ€” Would you happen to have any ideas or suggestions on how the alert system should work in this library?

from yetanotherhueapi.

fk0ff92 avatar fk0ff92 commented on June 26, 2024

Cool, I'm really glad you're interested and open to new features. In various implementations and also in the original API I have found hints that there must also be an "alert" in the state. The options for this are select (blink once) and lselect(blink ten times). The most sensible way would be to include it either via the state builder. Or you can wrap it and apply it to lights and rooms (groups). I also noticed that you work a lot with rooms, but a light group is hard to access. If you are interested to talk about more ideas let me know.

from yetanotherhueapi.

fk0ff92 avatar fk0ff92 commented on June 26, 2024

By the way, I use your implementation to implement a kind of Hue Disco. It is not necessary to implement it myself, because there are already many apps but I wanted to do it with a real beat detector and in real time on a raspberry pi. For me it's actually a bit cumbersome to use your builder, even if it's really super easy to use.I had to wrap your lights and your rooms unfortunately, because they are final and you don't allow any further implementations or inheritances. In my wrapper I built many methods that make the lights blink or flash. I was thinking about just developing your code further, but then I'm afraid that I can migrate updates from you only with difficulty.

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on June 26, 2024

Cumbersome, huh? Well, that's obviously not too good... I'd love to take a look at your code, if you wouldn't mind uploading it to GitHub? πŸ˜ƒ

Also, having now taken a look at the official docs, I would tend to agree that the state builder would be the best place to put the alert functionality into. πŸ‘

I'm not sure what you mean by saying that a light group is hard to access. What kind of a light group are we talking about? The library does support zones with the getZones() and getZoneByName(String) methods. They are completely analogous to the getRooms() and getRoomByName(String) methods.

from yetanotherhueapi.

fk0ff92 avatar fk0ff92 commented on June 26, 2024

I lack a bit of confidence to share my code with you without comment, because I'm still a student and just started actively programming java a few weeks ago. I had some help from my colleague who gave me code reviews. My code at the moment consists mainly of adding the general beat detector (https://github.com/generic-beat-detector/GBD). It was a lot of work to configure a raspberry pi with a microphone connected so that the general beat detector has something to analyze. I'm proud of the progress though, because now i get the "kick events" in real time, so i can react to every bass kick with a lamp reaction. Your used work can be found under functionalLight. This part of the implementation is as I said not very advanced yet, because I'm always thinking about how to access the lights and if and how to wrap them. I would like to have the functional light also as a functinal room, because some commands would be good if they would be executed synchronously by the whole room. I have shared the repository privately with you. Thanks for you input.

from yetanotherhueapi.

fk0ff92 avatar fk0ff92 commented on June 26, 2024

Probably I have then selected exactly the group type, which is not so implemented. I have a group in Hue called Alarm, which is neither a Zone nor a Room, but a Light group. The only way to get to it is this way.

hue.getGroupsOfType(GroupType.LIGHT_GROUP).stream().map(x-> x.getName() == "Alarm").findFirst()

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on June 26, 2024

Hey, thanks for sharing! The code looks very nice, nothing to be ashamed of there! ☺️

FunctionalLight looks like a sensible class. It follows the composition over inheritance principle. I can see your frustration with the transition time, your idea of .on(int) and .off(int) could be worth including with the library itself.

I certainly welcome new ideas, so keep them coming!

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on June 26, 2024

@fk0ff92 Hey, I just finished the alerting feature. I wonder if you might want to take a look at it before I merge it to master..? It's in pull request #33.

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on June 26, 2024

Alerts have been merged to master.

from yetanotherhueapi.

ZeroOne3010 avatar ZeroOne3010 commented on June 26, 2024

Alert functionality has been releases in version 2.1.0. Enjoy!

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.