Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
perosb committed Oct 22, 2017
1 parent 4732a0c commit e233573
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/components/google_assistant/test_smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,57 @@
const.SERVICE_TURN_ON,
{'entity_id': 'light.test', 'brightness': 242}
)
}, { # Test light color temperature
'entity_id': 'light.test',
'command': ga.const.COMMAND_COLOR,
'params': {
'color': {
'temperature': 2300,
'name': 'warm white'
}
},
'expected': (
const.SERVICE_TURN_ON,
{'entity_id': 'light.test', 'kelvin': 2300}
)
}, { # Test light color blue
'entity_id': 'light.test',
'command': ga.const.COMMAND_COLOR,
'params': {
'color': {
'spectrumRGB': 255,
'name': 'blue'
}
},
'expected': (
const.SERVICE_TURN_ON,
{'entity_id': 'light.test', 'rgb_color': [0, 0, 255]}
)
}, { # Test light color yellow
'entity_id': 'light.test',
'command': ga.const.COMMAND_COLOR,
'params': {
'color': {
'spectrumRGB': 16776960,
'name': 'yellow'
}
},
'expected': (
const.SERVICE_TURN_ON,
{'entity_id': 'light.test', 'rgb_color': [255, 255, 0]}
)
}, { # Test unhandled action/service
'entity_id': 'light.test',
'command': ga.const.COMMAND_COLOR,
'params': {
'color': {
'unhandled': 2300
}
},
'expected': (
None,
{'entity_id': 'light.test'}
)
}, { # Test light on / off
'entity_id': 'light.test',
'command': ga.const.COMMAND_ONOFF,
Expand Down

0 comments on commit e233573

Please sign in to comment.