Fix input_boolean Google Assistant serialize error (#13220)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-03-14 15:07:37 -07:00
1 parent a9917e7a56
commit e1a5e5a8ba
2 files changed
+31 -6

No files matched your search

@@ -1,4 +1,5 @@
"""Test Google Smart Home."""
from homeassistant.core import State
from homeassistant.const import (
ATTR_SUPPORTED_FEATURES, ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS)
from homeassistant.setup import async_setup_component
@@ -244,3 +245,17 @@ async def test_raising_error_trait(hass):
}]
}
}
def test_serialize_input_boolean():
"""Test serializing an input boolean entity."""
state = State('input_boolean.bla', 'on')
entity = sh._GoogleEntity(None, BASIC_CONFIG, state)
assert entity.sync_serialize() == {
'id': 'input_boolean.bla',
'attributes': {},
'name': {'name': 'bla'},
'traits': ['action.devices.traits.OnOff'],
'type': 'action.devices.types.SWITCH',
'willReportState': False,
}