mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use BinarySensorDeviceClass in ffmpeg (#61436)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
f1979f8b68
commit
25838e97e0
@ -3,8 +3,8 @@ import haffmpeg.sensor as ffmpeg_sensor
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_MOTION,
|
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.components.ffmpeg import (
|
from homeassistant.components.ffmpeg import (
|
||||||
@ -115,4 +115,4 @@ class FFmpegMotion(FFmpegBinarySensor):
|
|||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the class of this sensor, from DEVICE_CLASSES."""
|
"""Return the class of this sensor, from DEVICE_CLASSES."""
|
||||||
return DEVICE_CLASS_MOTION
|
return BinarySensorDeviceClass.MOTION
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
import haffmpeg.sensor as ffmpeg_sensor
|
import haffmpeg.sensor as ffmpeg_sensor
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import DEVICE_CLASS_SOUND, PLATFORM_SCHEMA
|
from homeassistant.components.binary_sensor import (
|
||||||
|
PLATFORM_SCHEMA,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
|
)
|
||||||
from homeassistant.components.ffmpeg import (
|
from homeassistant.components.ffmpeg import (
|
||||||
CONF_EXTRA_ARGUMENTS,
|
CONF_EXTRA_ARGUMENTS,
|
||||||
CONF_INITIAL_STATE,
|
CONF_INITIAL_STATE,
|
||||||
@ -78,4 +81,4 @@ class FFmpegNoise(FFmpegBinarySensor):
|
|||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the class of this sensor, from DEVICE_CLASSES."""
|
"""Return the class of this sensor, from DEVICE_CLASSES."""
|
||||||
return DEVICE_CLASS_SOUND
|
return BinarySensorDeviceClass.SOUND
|
||||||
|
Loading…
x
Reference in New Issue
Block a user