diff --git a/homeassistant/components/google_assistant/const.py b/homeassistant/components/google_assistant/const.py index efeb62deb8e..db0916fab02 100644 --- a/homeassistant/components/google_assistant/const.py +++ b/homeassistant/components/google_assistant/const.py @@ -62,6 +62,7 @@ DEFAULT_EXPOSED_DOMAINS = [ "vacuum", ] +# https://developers.google.com/assistant/smarthome/guides PREFIX_TYPES = "action.devices.types." TYPE_CAMERA = f"{PREFIX_TYPES}CAMERA" TYPE_LIGHT = f"{PREFIX_TYPES}LIGHT" @@ -85,6 +86,7 @@ TYPE_SETTOP = f"{PREFIX_TYPES}SETTOP" TYPE_HUMIDIFIER = f"{PREFIX_TYPES}HUMIDIFIER" TYPE_DEHUMIDIFIER = f"{PREFIX_TYPES}DEHUMIDIFIER" TYPE_RECEIVER = f"{PREFIX_TYPES}AUDIO_VIDEO_RECEIVER" +TYPE_CURTAIN = f"{PREFIX_TYPES}CURTAIN" SERVICE_REQUEST_SYNC = "request_sync" HOMEGRAPH_URL = "https://homegraph.googleapis.com/" @@ -149,6 +151,7 @@ DEVICE_CLASS_TO_GOOGLE_TYPES = { (cover.DOMAIN, cover.CoverDeviceClass.DOOR): TYPE_DOOR, (cover.DOMAIN, cover.CoverDeviceClass.AWNING): TYPE_AWNING, (cover.DOMAIN, cover.CoverDeviceClass.SHUTTER): TYPE_SHUTTER, + (cover.DOMAIN, cover.CoverDeviceClass.CURTAIN): TYPE_CURTAIN, (switch.DOMAIN, switch.SwitchDeviceClass.SWITCH): TYPE_SWITCH, (switch.DOMAIN, switch.SwitchDeviceClass.OUTLET): TYPE_OUTLET, (binary_sensor.DOMAIN, binary_sensor.BinarySensorDeviceClass.DOOR): TYPE_DOOR, diff --git a/tests/components/google_assistant/test_smart_home.py b/tests/components/google_assistant/test_smart_home.py index 911f66bb428..a97333f40e4 100644 --- a/tests/components/google_assistant/test_smart_home.py +++ b/tests/components/google_assistant/test_smart_home.py @@ -1021,10 +1021,14 @@ async def test_device_class_binary_sensor(hass, device_class, google_type): ("non_existing_class", "action.devices.types.BLINDS"), ("door", "action.devices.types.DOOR"), ("garage", "action.devices.types.GARAGE"), + ("gate", "action.devices.types.GARAGE"), + ("awning", "action.devices.types.AWNING"), + ("shutter", "action.devices.types.SHUTTER"), + ("curtain", "action.devices.types.CURTAIN"), ], ) async def test_device_class_cover(hass, device_class, google_type): - """Test that a binary entity syncs to the correct device type.""" + """Test that a cover entity syncs to the correct device type.""" sensor = DemoCover(None, hass, "Demo Sensor", device_class=device_class) sensor.hass = hass sensor.entity_id = "cover.demo_sensor"