Skip to content

Commit

Permalink
Device type garage for binary sensor garage_door (home-assistant#23345)
Browse files Browse the repository at this point in the history
* Switch binary sensor to garage for garage_door

* Add test for cover garage device type
  • Loading branch information
elupus authored and balloob committed Apr 24, 2019
1 parent 843bad8 commit 62fcb18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/google_assistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
(switch.DOMAIN, switch.DEVICE_CLASS_OUTLET): TYPE_OUTLET,
(binary_sensor.DOMAIN, binary_sensor.DEVICE_CLASS_DOOR): TYPE_DOOR,
(binary_sensor.DOMAIN, binary_sensor.DEVICE_CLASS_GARAGE_DOOR):
TYPE_SENSOR,
TYPE_GARAGE,
(binary_sensor.DOMAIN, binary_sensor.DEVICE_CLASS_LOCK): TYPE_SENSOR,
(binary_sensor.DOMAIN, binary_sensor.DEVICE_CLASS_OPENING): TYPE_SENSOR,
(binary_sensor.DOMAIN, binary_sensor.DEVICE_CLASS_WINDOW): TYPE_SENSOR,
Expand Down
3 changes: 2 additions & 1 deletion tests/components/google_assistant/test_smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ async def test_device_class_switch(hass, device_class, google_type):

@pytest.mark.parametrize("device_class,google_type", [
('door', 'action.devices.types.DOOR'),
('garage_door', 'action.devices.types.SENSOR'),
('garage_door', 'action.devices.types.GARAGE'),
('lock', 'action.devices.types.SENSOR'),
('opening', 'action.devices.types.SENSOR'),
('window', 'action.devices.types.SENSOR'),
Expand Down Expand Up @@ -646,6 +646,7 @@ async def test_device_class_binary_sensor(hass, device_class, google_type):
@pytest.mark.parametrize("device_class,google_type", [
('non_existing_class', 'action.devices.types.BLINDS'),
('door', 'action.devices.types.DOOR'),
('garage', 'action.devices.types.GARAGE'),
])
async def test_device_class_cover(hass, device_class, google_type):
"""Test that a binary entity syncs to the correct device type."""
Expand Down

0 comments on commit 62fcb18

Please sign in to comment.