From 25838e97e0b02b4dd9ef3761724c17719d3e01cb Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 10 Dec 2021 14:54:41 +0100 Subject: [PATCH] Use BinarySensorDeviceClass in ffmpeg (#61436) Co-authored-by: epenet --- homeassistant/components/ffmpeg_motion/binary_sensor.py | 4 ++-- homeassistant/components/ffmpeg_noise/binary_sensor.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/ffmpeg_motion/binary_sensor.py b/homeassistant/components/ffmpeg_motion/binary_sensor.py index ecbf6f3b1ae..292ec35fbff 100644 --- a/homeassistant/components/ffmpeg_motion/binary_sensor.py +++ b/homeassistant/components/ffmpeg_motion/binary_sensor.py @@ -3,8 +3,8 @@ import haffmpeg.sensor as ffmpeg_sensor import voluptuous as vol from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_MOTION, PLATFORM_SCHEMA, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.components.ffmpeg import ( @@ -115,4 +115,4 @@ class FFmpegMotion(FFmpegBinarySensor): @property def device_class(self): """Return the class of this sensor, from DEVICE_CLASSES.""" - return DEVICE_CLASS_MOTION + return BinarySensorDeviceClass.MOTION diff --git a/homeassistant/components/ffmpeg_noise/binary_sensor.py b/homeassistant/components/ffmpeg_noise/binary_sensor.py index 6c84c5973f1..7745d6fae2a 100644 --- a/homeassistant/components/ffmpeg_noise/binary_sensor.py +++ b/homeassistant/components/ffmpeg_noise/binary_sensor.py @@ -2,7 +2,10 @@ import haffmpeg.sensor as ffmpeg_sensor 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 ( CONF_EXTRA_ARGUMENTS, CONF_INITIAL_STATE, @@ -78,4 +81,4 @@ class FFmpegNoise(FFmpegBinarySensor): @property def device_class(self): """Return the class of this sensor, from DEVICE_CLASSES.""" - return DEVICE_CLASS_SOUND + return BinarySensorDeviceClass.SOUND