Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing color of a light or room #7

Closed
DanielBlik opened this issue Apr 15, 2019 · 4 comments
Closed

Changing color of a light or room #7

DanielBlik opened this issue Apr 15, 2019 · 4 comments

Comments

@DanielBlik
Copy link

is there a way to change the color since i have been struggling with this for several hours
still a beginner programmer so sorry if this is a stupid quetstion
image

@ZeroOne3010
Copy link
Owner

Please notice how your IDE is underlining some items in red. It is trying to help you. This means that you have a syntax error there. Consider the three lines of code you have, i.e. excluding the method definition and the curly brackets. On the first line you have a typo in the word builder ("buidler") and you haven't capitalized the the class name Color. On the second line it highlights the builder() method which leads me to think you have imported the wrong State. Finally, on the third line the method color(...) is highlighted because a Light does not have such a method. The correct way to do it would be this: room.setState(State.builder().color(java.awt.Color.PINK).on()); assuming the correct State has been imported from the same package as Hue.

@DanielBlik
Copy link
Author

ah sorry for the small mistakes like "buidler " stupid of me. But what do you mean by importing the right state have been googling that but cant seem to find anything related to "importing a state"

@ZeroOne3010
Copy link
Owner

I mean that you should import the State class from this library and not some other State, so you should have this line: import io.github.zeroone3010.yahueapi.State;. Or, if you already have imported io.github.zeroone3010.yahueapi.*, then that should be enough. Just make sure you haven't imported any other class by the name of State, that's what I mean. So if you have anything like "import javax.swing.plaf.nimbus.State;" or "import sun.java2d.StateTrackable.State;", you should get rid of those.

@DanielBlik
Copy link
Author

GOT IT !!!!

thanks a lot turns out while making a type error it gave an error and suggesting a state import which interfered
thank you so much your awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants