mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add support for curtain device class to google assistant (#63380)
This commit is contained in:
parent
40262c4763
commit
75f8e031df
@ -62,6 +62,7 @@ DEFAULT_EXPOSED_DOMAINS = [
|
|||||||
"vacuum",
|
"vacuum",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# https://developers.google.com/assistant/smarthome/guides
|
||||||
PREFIX_TYPES = "action.devices.types."
|
PREFIX_TYPES = "action.devices.types."
|
||||||
TYPE_CAMERA = f"{PREFIX_TYPES}CAMERA"
|
TYPE_CAMERA = f"{PREFIX_TYPES}CAMERA"
|
||||||
TYPE_LIGHT = f"{PREFIX_TYPES}LIGHT"
|
TYPE_LIGHT = f"{PREFIX_TYPES}LIGHT"
|
||||||
@ -85,6 +86,7 @@ TYPE_SETTOP = f"{PREFIX_TYPES}SETTOP"
|
|||||||
TYPE_HUMIDIFIER = f"{PREFIX_TYPES}HUMIDIFIER"
|
TYPE_HUMIDIFIER = f"{PREFIX_TYPES}HUMIDIFIER"
|
||||||
TYPE_DEHUMIDIFIER = f"{PREFIX_TYPES}DEHUMIDIFIER"
|
TYPE_DEHUMIDIFIER = f"{PREFIX_TYPES}DEHUMIDIFIER"
|
||||||
TYPE_RECEIVER = f"{PREFIX_TYPES}AUDIO_VIDEO_RECEIVER"
|
TYPE_RECEIVER = f"{PREFIX_TYPES}AUDIO_VIDEO_RECEIVER"
|
||||||
|
TYPE_CURTAIN = f"{PREFIX_TYPES}CURTAIN"
|
||||||
|
|
||||||
SERVICE_REQUEST_SYNC = "request_sync"
|
SERVICE_REQUEST_SYNC = "request_sync"
|
||||||
HOMEGRAPH_URL = "https://homegraph.googleapis.com/"
|
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.DOOR): TYPE_DOOR,
|
||||||
(cover.DOMAIN, cover.CoverDeviceClass.AWNING): TYPE_AWNING,
|
(cover.DOMAIN, cover.CoverDeviceClass.AWNING): TYPE_AWNING,
|
||||||
(cover.DOMAIN, cover.CoverDeviceClass.SHUTTER): TYPE_SHUTTER,
|
(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.SWITCH): TYPE_SWITCH,
|
||||||
(switch.DOMAIN, switch.SwitchDeviceClass.OUTLET): TYPE_OUTLET,
|
(switch.DOMAIN, switch.SwitchDeviceClass.OUTLET): TYPE_OUTLET,
|
||||||
(binary_sensor.DOMAIN, binary_sensor.BinarySensorDeviceClass.DOOR): TYPE_DOOR,
|
(binary_sensor.DOMAIN, binary_sensor.BinarySensorDeviceClass.DOOR): TYPE_DOOR,
|
||||||
|
@ -1021,10 +1021,14 @@ async def test_device_class_binary_sensor(hass, device_class, google_type):
|
|||||||
("non_existing_class", "action.devices.types.BLINDS"),
|
("non_existing_class", "action.devices.types.BLINDS"),
|
||||||
("door", "action.devices.types.DOOR"),
|
("door", "action.devices.types.DOOR"),
|
||||||
("garage", "action.devices.types.GARAGE"),
|
("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):
|
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 = DemoCover(None, hass, "Demo Sensor", device_class=device_class)
|
||||||
sensor.hass = hass
|
sensor.hass = hass
|
||||||
sensor.entity_id = "cover.demo_sensor"
|
sensor.entity_id = "cover.demo_sensor"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user