Use DEVICE_CLASS_MOTION in various integrations (#39962)

This commit is contained in:
springstan 2020-09-12 23:20:30 +02:00 committed by GitHub
parent 02cb592917
commit e55035b2f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 59 additions and 31 deletions

View file

@ -1,5 +1,8 @@
"""Demo platform that has two fake binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOTION,
BinarySensorEntity,
)
from . import DOMAIN
@ -9,7 +12,9 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(
[
DemoBinarySensor("binary_1", "Basement Floor Wet", False, "moisture"),
DemoBinarySensor("binary_2", "Movement Backyard", True, "motion"),
DemoBinarySensor(
"binary_2", "Movement Backyard", True, DEVICE_CLASS_MOTION
),
]
)