mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Move imports to top for solaredge (#29463)
This commit is contained in:
parent
dbd231b3a0
commit
24878f109c
@ -6,7 +6,7 @@ from homeassistant.const import CONF_API_KEY, CONF_NAME
|
|||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
from homeassistant.helpers.typing import HomeAssistantType
|
||||||
|
|
||||||
from .const import DEFAULT_NAME, DOMAIN, CONF_SITE_ID
|
from .const import CONF_SITE_ID, DEFAULT_NAME, DOMAIN
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema(
|
CONFIG_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
"""Config flow for the SolarEdge platform."""
|
"""Config flow for the SolarEdge platform."""
|
||||||
|
from requests.exceptions import ConnectTimeout, HTTPError
|
||||||
import solaredge
|
import solaredge
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from requests.exceptions import HTTPError, ConnectTimeout
|
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.const import CONF_API_KEY, CONF_NAME
|
from homeassistant.const import CONF_API_KEY, CONF_NAME
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
from .const import DOMAIN, DEFAULT_NAME, CONF_SITE_ID
|
from .const import CONF_SITE_ID, DEFAULT_NAME, DOMAIN
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Constants for the SolarEdge Monitoring API."""
|
"""Constants for the SolarEdge Monitoring API."""
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import POWER_WATT, ENERGY_WATT_HOUR
|
from homeassistant.const import ENERGY_WATT_HOUR, POWER_WATT
|
||||||
|
|
||||||
DOMAIN = "solaredge"
|
DOMAIN = "solaredge"
|
||||||
|
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
"""Support for SolarEdge Monitoring API."""
|
"""Support for SolarEdge Monitoring API."""
|
||||||
import logging
|
import logging
|
||||||
import solaredge
|
|
||||||
|
|
||||||
from requests.exceptions import HTTPError, ConnectTimeout
|
from requests.exceptions import ConnectTimeout, HTTPError
|
||||||
|
import solaredge
|
||||||
|
from stringcase import snakecase
|
||||||
|
|
||||||
from homeassistant.const import CONF_API_KEY
|
from homeassistant.const import CONF_API_KEY
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_SITE_ID,
|
CONF_SITE_ID,
|
||||||
OVERVIEW_UPDATE_DELAY,
|
|
||||||
DETAILS_UPDATE_DELAY,
|
DETAILS_UPDATE_DELAY,
|
||||||
INVENTORY_UPDATE_DELAY,
|
INVENTORY_UPDATE_DELAY,
|
||||||
|
OVERVIEW_UPDATE_DELAY,
|
||||||
POWER_FLOW_UPDATE_DELAY,
|
POWER_FLOW_UPDATE_DELAY,
|
||||||
SENSOR_TYPES,
|
SENSOR_TYPES,
|
||||||
)
|
)
|
||||||
@ -262,7 +264,6 @@ class SolarEdgeDetailsDataService(SolarEdgeDataService):
|
|||||||
@Throttle(DETAILS_UPDATE_DELAY)
|
@Throttle(DETAILS_UPDATE_DELAY)
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the data from the SolarEdge Monitoring API."""
|
"""Update the data from the SolarEdge Monitoring API."""
|
||||||
from stringcase import snakecase
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = self.api.get_details(self.site_id)
|
data = self.api.get_details(self.site_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user