mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Move import for htu21d component (#27908)
This commit is contained in:
parent
435cbb7f7e
commit
2110fea02b
@ -3,11 +3,13 @@ from datetime import timedelta
|
||||
from functools import partial
|
||||
import logging
|
||||
|
||||
from i2csense.htu21d import HTU21D # pylint: disable=import-error
|
||||
import smbus # pylint: disable=import-error
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import CONF_NAME, TEMP_FAHRENHEIT
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
from homeassistant.util.temperature import celsius_to_fahrenheit
|
||||
@ -34,9 +36,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
"""Set up the HTU21D sensor."""
|
||||
import smbus # pylint: disable=import-error
|
||||
from i2csense.htu21d import HTU21D # pylint: disable=import-error
|
||||
|
||||
name = config.get(CONF_NAME)
|
||||
bus_number = config.get(CONF_I2C_BUS)
|
||||
temp_unit = hass.config.units.temperature_unit
|
||||
|
Loading…
x
Reference in New Issue
Block a user