-
Notifications
You must be signed in to change notification settings - Fork 35
setting state.on to the right value after sending state changes to the bridge #38 #39
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4ff3311
setting state.on to the right value after sending state changes to th…
willie68 3afcf16
adding set color to light
willie68 78fdfee
removing state.on bug on group, too
willie68 9d348ae
Resolving the review comments for #39
willie68 f108116
adding test for ConvertRGBToXy function.
willie68 7b87339
Missed a single line in AlertContext
willie68 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| package huego | ||
|
|
||
| import ( | ||
| "github.com/stretchr/testify/assert" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestGetLights(t *testing.T) { | ||
|
|
@@ -149,6 +150,7 @@ func TestTurnOffLight(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.False(t, light.IsOn()) | ||
| t.Logf("Turned off light with id %d", light.ID) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -167,6 +169,7 @@ func TestTurnOnLight(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
| t.Logf("Turned on light with id %d", light.ID) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -214,6 +217,7 @@ func TestSetLightBri(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
| t.Logf("Brightness of light %d set to %d", light.ID, light.State.Bri) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -232,6 +236,7 @@ func TestSetLightHue(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
| t.Logf("Hue of light %d set to %d", light.ID, light.State.Hue) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -250,6 +255,7 @@ func TestSetLightSat(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
| t.Logf("Sat of light %d set to %d", light.ID, light.State.Sat) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -269,6 +275,7 @@ func TestSetLightXy(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
| t.Logf("Xy of light %d set to %+v", light.ID, light.State.Xy) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -287,6 +294,7 @@ func TestSetLightCt(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
| t.Logf("Ct of light %d set to %d", light.ID, light.State.Ct) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -323,6 +331,7 @@ func TestSetLightEffect(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
| t.Logf("Effect of light %d set to %s", light.ID, light.State.Effect) | ||
|
|
||
| b.Host = badHostname | ||
|
|
@@ -341,6 +350,7 @@ func TestSetLightAlert(t *testing.T) { | |
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| assert.True(t, light.IsOn()) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is why tests fails. It doesn't receive expected result. Can you have a look? |
||
| t.Logf("Alert of light %d set to %s", light.ID, light.State.Alert) | ||
|
|
||
| b.Host = badHostname | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.