Move imports for ebusd component (#27979)
parent
8356d92f04
commit
ca0a4a8750
|
@ -3,13 +3,14 @@ from datetime import timedelta
|
|||
import logging
|
||||
import socket
|
||||
|
||||
import ebusdpy
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_HOST,
|
||||
CONF_PORT,
|
||||
CONF_MONITORED_CONDITIONS,
|
||||
CONF_NAME,
|
||||
CONF_PORT,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.discovery import load_platform
|
||||
|
@ -66,7 +67,6 @@ def setup(hass, config):
|
|||
|
||||
try:
|
||||
_LOGGER.debug("Ebusd integration setup started")
|
||||
import ebusdpy
|
||||
|
||||
ebusdpy.init(server_address)
|
||||
hass.data[DOMAIN] = EbusdData(server_address, circuit)
|
||||
|
@ -98,8 +98,6 @@ class EbusdData:
|
|||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||
def update(self, name, stype):
|
||||
"""Call the Ebusd API to update the data."""
|
||||
import ebusdpy
|
||||
|
||||
try:
|
||||
_LOGGER.debug("Opening socket to ebusd %s", name)
|
||||
command_result = ebusdpy.read(
|
||||
|
@ -116,8 +114,6 @@ class EbusdData:
|
|||
|
||||
def write(self, call):
|
||||
"""Call write methon on ebusd."""
|
||||
import ebusdpy
|
||||
|
||||
name = call.data.get("name")
|
||||
value = call.data.get("value")
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""Constants for ebus component."""
|
||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, TEMP_CELSIUS, PRESSURE_BAR
|
||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, PRESSURE_BAR, TEMP_CELSIUS
|
||||
|
||||
DOMAIN = "ebusd"
|
||||
TIME_SECONDS = "seconds"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"""Support for Ebusd sensors."""
|
||||
import logging
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
|
Loading…
Reference in New Issue