Clean up upcloud (#61971)

This commit is contained in:
Robert Hillis 2021-12-16 09:14:46 -05:00 committed by GitHub
parent 029af94d28
commit b315877ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 18 deletions

View File

@ -1,23 +1,15 @@
"""Support for monitoring the state of UpCloud servers.""" """Support for monitoring the state of UpCloud servers."""
import voluptuous as vol
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA,
BinarySensorDeviceClass, BinarySensorDeviceClass,
BinarySensorEntity, BinarySensorEntity,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_USERNAME from homeassistant.const import CONF_USERNAME
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import CONF_SERVERS, DATA_UPCLOUD, UpCloudServerEntity from . import DATA_UPCLOUD, UpCloudServerEntity
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{vol.Required(CONF_SERVERS): vol.All(cv.ensure_list, [cv.string])}
)
async def async_setup_entry( async def async_setup_entry(

View File

@ -2,21 +2,14 @@
from typing import Any from typing import Any
import voluptuous as vol from homeassistant.components.switch import SwitchEntity
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_USERNAME, STATE_OFF from homeassistant.const import CONF_USERNAME, STATE_OFF
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import dispatcher_send from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import CONF_SERVERS, DATA_UPCLOUD, SIGNAL_UPDATE_UPCLOUD, UpCloudServerEntity from . import DATA_UPCLOUD, SIGNAL_UPDATE_UPCLOUD, UpCloudServerEntity
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{vol.Required(CONF_SERVERS): vol.All(cv.ensure_list, [cv.string])}
)
async def async_setup_entry( async def async_setup_entry(