Move imports to top for ffmpeg_motion and ffmpeg_noise (#29026)
* Move imports to top for ffmpeg_motion and ffmpeg_noise * Fixed tests
This commit is contained in:
parent
71bafba9ec
commit
ccb05764b6
2 changed files with 8 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
"""Provides a binary sensor which is a collection of ffmpeg tools."""
|
||||
import logging
|
||||
|
||||
import haffmpeg.sensor as ffmpeg_sensor
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import callback
|
||||
|
@ -87,10 +88,11 @@ class FFmpegMotion(FFmpegBinarySensor):
|
|||
|
||||
def __init__(self, hass, manager, config):
|
||||
"""Initialize FFmpeg motion binary sensor."""
|
||||
from haffmpeg.sensor import SensorMotion
|
||||
|
||||
super().__init__(config)
|
||||
self.ffmpeg = SensorMotion(manager.binary, hass.loop, self._async_callback)
|
||||
self.ffmpeg = ffmpeg_sensor.SensorMotion(
|
||||
manager.binary, hass.loop, self._async_callback
|
||||
)
|
||||
|
||||
async def _async_start_ffmpeg(self, entity_ids):
|
||||
"""Start a FFmpeg instance.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""Provides a binary sensor which is a collection of ffmpeg tools."""
|
||||
import logging
|
||||
|
||||
import haffmpeg.sensor as ffmpeg_sensor
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -54,10 +55,11 @@ class FFmpegNoise(FFmpegBinarySensor):
|
|||
|
||||
def __init__(self, hass, manager, config):
|
||||
"""Initialize FFmpeg noise binary sensor."""
|
||||
from haffmpeg.sensor import SensorNoise
|
||||
|
||||
super().__init__(config)
|
||||
self.ffmpeg = SensorNoise(manager.binary, hass.loop, self._async_callback)
|
||||
self.ffmpeg = ffmpeg_sensor.SensorNoise(
|
||||
manager.binary, hass.loop, self._async_callback
|
||||
)
|
||||
|
||||
async def _async_start_ffmpeg(self, entity_ids):
|
||||
"""Start a FFmpeg instance.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue