mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Move imports to top for rpi_rf (#29271)
This commit is contained in:
parent
7ad139bb63
commit
869e71f455
@ -1,10 +1,11 @@
|
||||
"""Support for a switch using a 433MHz module via GPIO on a Raspberry Pi."""
|
||||
import importlib
|
||||
import logging
|
||||
from threading import RLock
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
|
||||
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
|
||||
from homeassistant.const import CONF_NAME, CONF_SWITCHES, EVENT_HOMEASSISTANT_STOP
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
@ -44,7 +45,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Find and return switches controlled by a generic RF device via GPIO."""
|
||||
rpi_rf = importlib.import_module("rpi_rf")
|
||||
from threading import RLock
|
||||
|
||||
gpio = config.get(CONF_GPIO)
|
||||
rfdevice = rpi_rf.RFDevice(gpio)
|
||||
|
Loading…
x
Reference in New Issue
Block a user