mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Grammar and spelling fixes (#16065)
This commit is contained in:
parent
9e1fa7ef42
commit
dbd0763f83
@ -307,7 +307,7 @@ def async_enable_logging(hass: core.HomeAssistant,
|
||||
hass.data[DATA_LOGGING] = err_log_path
|
||||
else:
|
||||
_LOGGER.error(
|
||||
"Unable to setup error log %s (access denied)", err_log_path)
|
||||
"Unable to set up error log %s (access denied)", err_log_path)
|
||||
|
||||
|
||||
async def async_mount_local_lib_path(config_dir: str) -> str:
|
||||
|
@ -141,7 +141,7 @@ def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -45,7 +45,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
try:
|
||||
simplisafe = SimpliSafeApiInterface(username, password)
|
||||
except SimpliSafeAPIException:
|
||||
_LOGGER.error("Failed to setup SimpliSafe")
|
||||
_LOGGER.error("Failed to set up SimpliSafe")
|
||||
return
|
||||
|
||||
systems = []
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
Allow to setup simple automation rules via the config file.
|
||||
Allow to set up simple automation rules via the config file.
|
||||
|
||||
For more details about this component, please refer to the documentation at
|
||||
https://home-assistant.io/components/automation/
|
||||
|
@ -58,7 +58,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
data = HikvisionData(hass, url, port, name, username, password)
|
||||
|
||||
if data.sensors is None:
|
||||
_LOGGER.error("Hikvision event stream has no data, unable to setup")
|
||||
_LOGGER.error("Hikvision event stream has no data, unable to set up")
|
||||
return False
|
||||
|
||||
entities = []
|
||||
|
@ -145,7 +145,7 @@ async def async_get_image(hass, entity_id, timeout=10):
|
||||
component = hass.data.get(DOMAIN)
|
||||
|
||||
if component is None:
|
||||
raise HomeAssistantError('Camera component not setup')
|
||||
raise HomeAssistantError('Camera component not set up')
|
||||
|
||||
camera = component.get_entity(entity_id)
|
||||
|
||||
@ -214,7 +214,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
},
|
||||
"step": {
|
||||
"confirm": {
|
||||
"description": "Do you want to setup Google Cast?",
|
||||
"description": "Do you want to set up Google Cast?",
|
||||
"title": "Google Cast"
|
||||
}
|
||||
},
|
||||
"title": "Google Cast"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
"step": {
|
||||
"confirm": {
|
||||
"title": "Google Cast",
|
||||
"description": "Do you want to setup Google Cast?"
|
||||
"description": "Do you want to set up Google Cast?"
|
||||
}
|
||||
},
|
||||
"abort": {
|
||||
|
@ -294,7 +294,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ async def async_setup_entry(hass, config_entry):
|
||||
|
||||
@callback
|
||||
def async_add_remote(sensors):
|
||||
"""Setup remote from deCONZ."""
|
||||
"""Set up remote from deCONZ."""
|
||||
from pydeconz.sensor import SWITCH as DECONZ_REMOTE
|
||||
allow_clip_sensor = config_entry.data.get(CONF_ALLOW_CLIP_SENSOR, True)
|
||||
for sensor in sensors:
|
||||
|
@ -57,7 +57,7 @@ class RitAssistDeviceScanner:
|
||||
config.get(CONF_PASSWORD))
|
||||
|
||||
def setup(self, hass):
|
||||
"""Setup a timer and start gathering devices."""
|
||||
"""Set up a timer and start gathering devices."""
|
||||
self._refresh()
|
||||
track_utc_time_change(hass,
|
||||
lambda now: self._refresh(),
|
||||
|
@ -57,7 +57,7 @@ CONFIG_SCHEMA = vol.Schema({
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
"""Setup the HomeKit component."""
|
||||
"""Set up the HomeKit component."""
|
||||
_LOGGER.debug('Begin setup HomeKit')
|
||||
|
||||
conf = config[DOMAIN]
|
||||
@ -196,7 +196,7 @@ class HomeKit():
|
||||
self.driver = None
|
||||
|
||||
def setup(self):
|
||||
"""Setup bridge and accessory driver."""
|
||||
"""Set up bridge and accessory driver."""
|
||||
from .accessories import HomeBridge, HomeDriver
|
||||
|
||||
self.hass.bus.async_listen_once(
|
||||
|
@ -109,7 +109,7 @@ def show_setup_message(hass, pincode):
|
||||
"""Display persistent notification with setup information."""
|
||||
pin = pincode.decode()
|
||||
_LOGGER.info('Pincode: %s', pin)
|
||||
message = 'To setup Home Assistant in the Home App, enter the ' \
|
||||
message = 'To set up Home Assistant in the Home App, enter the ' \
|
||||
'following code:\n### {}'.format(pin)
|
||||
hass.components.persistent_notification.create(
|
||||
message, 'HomeKit Setup', HOMEKIT_NOTIFY_ID)
|
||||
|
@ -1,4 +1,4 @@
|
||||
"""Provide cors support for the HTTP component."""
|
||||
"""Provide CORS support for the HTTP component."""
|
||||
|
||||
|
||||
from aiohttp.hdrs import ACCEPT, ORIGIN, CONTENT_TYPE
|
||||
@ -17,7 +17,7 @@ ALLOWED_CORS_HEADERS = [
|
||||
|
||||
@callback
|
||||
def setup_cors(app, origins):
|
||||
"""Setup cors."""
|
||||
"""Set up CORS."""
|
||||
import aiohttp_cors
|
||||
|
||||
cors = aiohttp_cors.setup(app, defaults={
|
||||
@ -30,7 +30,7 @@ def setup_cors(app, origins):
|
||||
cors_added = set()
|
||||
|
||||
def _allow_cors(route, config=None):
|
||||
"""Allow cors on a route."""
|
||||
"""Allow CORS on a route."""
|
||||
if hasattr(route, 'resource'):
|
||||
path = route.resource
|
||||
else:
|
||||
@ -55,7 +55,7 @@ def setup_cors(app, origins):
|
||||
return
|
||||
|
||||
async def cors_startup(app):
|
||||
"""Initialize cors when app starts up."""
|
||||
"""Initialize CORS when app starts up."""
|
||||
for route in list(app.router.routes()):
|
||||
_allow_cors(route)
|
||||
|
||||
|
@ -123,7 +123,7 @@ def setup(hass, config):
|
||||
|
||||
|
||||
def autosetup_ihc_products(hass: HomeAssistantType, config, ihc_controller):
|
||||
"""Auto setup of IHC products from the ihc project file."""
|
||||
"""Auto setup of IHC products from the IHC project file."""
|
||||
project_xml = ihc_controller.get_project()
|
||||
if not project_xml:
|
||||
_LOGGER.error("Unable to read project from ICH controller")
|
||||
@ -177,7 +177,7 @@ def get_discovery_info(component_setup, groups):
|
||||
|
||||
|
||||
def setup_service_functions(hass: HomeAssistantType, ihc_controller):
|
||||
"""Setup the IHC service functions."""
|
||||
"""Set up the IHC service functions."""
|
||||
def set_runtime_value_bool(call):
|
||||
"""Set a IHC runtime bool value service function."""
|
||||
ihc_id = call.data[ATTR_IHC_ID]
|
||||
|
@ -1,26 +1,26 @@
|
||||
# Describes the format for available ihc services
|
||||
# Describes the format for available IHC services
|
||||
|
||||
set_runtime_value_bool:
|
||||
description: Set a boolean runtime value on the ihc controller
|
||||
description: Set a boolean runtime value on the IHC controller
|
||||
fields:
|
||||
ihc_id:
|
||||
description: The integer ihc resource id
|
||||
description: The integer IHC resource id
|
||||
value:
|
||||
description: The boolean value to set
|
||||
|
||||
set_runtime_value_int:
|
||||
description: Set an integer runtime value on the ihc controller
|
||||
description: Set an integer runtime value on the IHC controller
|
||||
fields:
|
||||
ihc_id:
|
||||
description: The integer ihc resource id
|
||||
description: The integer IHC resource id
|
||||
value:
|
||||
description: The integer value to set
|
||||
|
||||
set_runtime_value_float:
|
||||
description: Set a float runtime value on the ihc controller
|
||||
description: Set a float runtime value on the IHC controller
|
||||
fields:
|
||||
ihc_id:
|
||||
description: The integer ihc resource id
|
||||
description: The integer IHC resource id
|
||||
value:
|
||||
description: The float value to set
|
||||
|
||||
|
@ -382,7 +382,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the ihc lights platform."""
|
||||
"""Set up the IHC lights platform."""
|
||||
ihc_controller = hass.data[IHC_DATA][IHC_CONTROLLER]
|
||||
info = hass.data[IHC_DATA][IHC_INFO]
|
||||
devices = []
|
||||
@ -109,7 +109,7 @@ class IhcLight(IHCDevice, Light):
|
||||
self.ihc_controller.set_runtime_value_bool(self.ihc_id, False)
|
||||
|
||||
def on_ihc_change(self, ihc_id, value):
|
||||
"""Callback from Ihc notifications."""
|
||||
"""Callback from IHC notifications."""
|
||||
if isinstance(value, bool):
|
||||
self._dimmable = False
|
||||
self._state = value != 0
|
||||
|
@ -37,7 +37,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup LW-12 WiFi LED Controller platform."""
|
||||
"""Set up LW-12 WiFi LED Controller platform."""
|
||||
import lw12
|
||||
|
||||
# Assign configuration variables.
|
||||
|
@ -17,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the BMW Connected Drive lock."""
|
||||
"""Set up the BMW Connected Drive lock."""
|
||||
accounts = hass.data[BMW_DOMAIN]
|
||||
_LOGGER.debug('Found BMW accounts: %s',
|
||||
', '.join([a.name for a in accounts]))
|
||||
|
@ -461,7 +461,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ REQUIREMENTS = ['pychannels==1.0.0']
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the Channels platform."""
|
||||
"""Set up the Channels platform."""
|
||||
device = ChannelsPlayer(
|
||||
config.get('name'),
|
||||
config.get(CONF_HOST),
|
||||
|
@ -62,7 +62,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
||||
device = VizioDevice(host, token, name, volume_step)
|
||||
if device.validate_setup() is False:
|
||||
_LOGGER.error("Failed to setup Vizio TV platform, "
|
||||
_LOGGER.error("Failed to set up Vizio TV platform, "
|
||||
"please check if host and API key are correct")
|
||||
return
|
||||
|
||||
|
@ -133,7 +133,7 @@ def setup_mysensors_platform(
|
||||
async_add_devices=None):
|
||||
"""Set up a MySensors platform."""
|
||||
# Only act if called via MySensors by discovery event.
|
||||
# Otherwise gateway is not setup.
|
||||
# Otherwise gateway is not set up.
|
||||
if not discovery_info:
|
||||
return
|
||||
if device_args is None:
|
||||
|
@ -119,7 +119,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup Nest from a config entry."""
|
||||
"""Set up Nest from a config entry."""
|
||||
from nest import Nest
|
||||
|
||||
nest = Nest(access_token=entry.data['tokens']['access_token'])
|
||||
|
@ -110,7 +110,7 @@ async def async_configure_sabnzbd(hass, config, use_ssl, name=DEFAULT_NAME,
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
"""Setup the SABnzbd component."""
|
||||
"""Set up the SABnzbd component."""
|
||||
async def sabnzbd_discovered(service, info):
|
||||
"""Handle service discovery."""
|
||||
ssl = info.get('properties', {}).get('https', '0') == '1'
|
||||
@ -129,7 +129,7 @@ async def async_setup(hass, config):
|
||||
|
||||
@callback
|
||||
def async_setup_sabnzbd(hass, sab_api, config, name):
|
||||
"""Setup SABnzbd sensors and services."""
|
||||
"""Set up SABnzbd sensors and services."""
|
||||
sab_api_data = SabnzbdApiData(sab_api, name, config.get(CONF_SENSORS, {}))
|
||||
|
||||
if config.get(CONF_SENSORS):
|
||||
|
@ -95,7 +95,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
Counter for the days till a HTTPS (TLS) certificate will expire.
|
||||
Counter for the days until an HTTPS (TLS) certificate will expire.
|
||||
|
||||
For more details about this sensor please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.cert_expiry/
|
||||
|
@ -28,7 +28,7 @@ LAST_BILL_DAYS_BILLED = "last_bills_days_billed"
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup all Duke Energy meters."""
|
||||
"""Set up all Duke Energy meters."""
|
||||
from pydukeenergy.api import DukeEnergy, DukeEnergyException
|
||||
|
||||
try:
|
||||
@ -36,7 +36,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
config[CONF_PASSWORD],
|
||||
update_interval=120)
|
||||
except DukeEnergyException:
|
||||
_LOGGER.error("Failed to setup Duke Energy")
|
||||
_LOGGER.error("Failed to set up Duke Energy")
|
||||
return
|
||||
|
||||
add_devices([DukeEnergyMeter(meter) for meter in duke.get_meters()])
|
||||
|
@ -151,7 +151,7 @@ class FinTsClient:
|
||||
|
||||
|
||||
class FinTsAccount(Entity):
|
||||
"""Sensor for a FinTS balanc account.
|
||||
"""Sensor for a FinTS balance account.
|
||||
|
||||
A balance account contains an amount of money (=balance). The amount may
|
||||
also be negative.
|
||||
|
@ -31,7 +31,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the ihc sensor platform."""
|
||||
"""Set up the IHC sensor platform."""
|
||||
ihc_controller = hass.data[IHC_DATA][IHC_CONTROLLER]
|
||||
info = hass.data[IHC_DATA][IHC_INFO]
|
||||
devices = []
|
||||
@ -77,6 +77,6 @@ class IHCSensor(IHCDevice, Entity):
|
||||
return self._unit_of_measurement
|
||||
|
||||
def on_ihc_change(self, ihc_id, value):
|
||||
"""Callback when ihc resource changes."""
|
||||
"""Callback when IHC resource changes."""
|
||||
self._state = value
|
||||
self.schedule_update_ha_state()
|
||||
|
@ -16,7 +16,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the melissa sensor platform."""
|
||||
"""Set up the melissa sensor platform."""
|
||||
sensors = []
|
||||
api = hass.data[DATA_MELISSA]
|
||||
devices = api.fetch_devices().values()
|
||||
|
@ -164,7 +164,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
data = PyNUTData(host, port, alias, username, password)
|
||||
|
||||
if data.status is None:
|
||||
_LOGGER.error("NUT Sensor has no data, unable to setup")
|
||||
_LOGGER.error("NUT Sensor has no data, unable to set up")
|
||||
raise PlatformNotReady
|
||||
|
||||
_LOGGER.debug('NUT Sensors Available: %s', data.status)
|
||||
|
@ -47,7 +47,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the sensor platform."""
|
||||
"""Set up the sensor platform."""
|
||||
from Adafruit_SHT31 import SHT31
|
||||
|
||||
i2c_address = config.get(CONF_I2C_ADDRESS)
|
||||
|
@ -77,7 +77,7 @@ class SigfoxAPI:
|
||||
_LOGGER.error(
|
||||
"Unable to login to Sigfox API, error code %s", str(
|
||||
response.status_code))
|
||||
raise ValueError('Sigfox component not setup')
|
||||
raise ValueError('Sigfox component not set up')
|
||||
return True
|
||||
|
||||
def get_device_types(self):
|
||||
|
@ -29,7 +29,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setting the platform in HASS and Case Information."""
|
||||
"""Set up the platform in HASS and Case Information."""
|
||||
uscis = UscisSensor(config['case_id'], config[CONF_FRIENDLY_NAME])
|
||||
uscis.update()
|
||||
if uscis.valid_case_id:
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
Sensor support for Wirelss Sensor Tags platform.
|
||||
Sensor support for Wireless Sensor Tags platform.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.wirelesstag/
|
||||
@ -58,7 +58,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the sensor platform."""
|
||||
"""Set up the sensor platform."""
|
||||
platform = hass.data.get(WIRELESSTAG_DOMAIN)
|
||||
sensors = []
|
||||
tags = platform.tags
|
||||
|
@ -6,10 +6,10 @@
|
||||
},
|
||||
"step": {
|
||||
"confirm": {
|
||||
"description": "Do you want to setup Sonos?",
|
||||
"description": "Do you want to set up Sonos?",
|
||||
"title": "Sonos"
|
||||
}
|
||||
},
|
||||
"title": "Sonos"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
"step": {
|
||||
"confirm": {
|
||||
"title": "Sonos",
|
||||
"description": "Do you want to setup Sonos?"
|
||||
"description": "Do you want to set up Sonos?"
|
||||
}
|
||||
},
|
||||
"abort": {
|
||||
|
@ -117,7 +117,7 @@ async def async_setup(hass, config):
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
return await hass.data[DOMAIN].async_setup_entry(entry)
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the ihc switch platform."""
|
||||
"""Set up the IHC switch platform."""
|
||||
ihc_controller = hass.data[IHC_DATA][IHC_CONTROLLER]
|
||||
info = hass.data[IHC_DATA][IHC_INFO]
|
||||
devices = []
|
||||
@ -70,6 +70,6 @@ class IHCSwitch(IHCDevice, SwitchDevice):
|
||||
self.ihc_controller.set_runtime_value_bool(self.ihc_id, False)
|
||||
|
||||
def on_ihc_change(self, ihc_id, value):
|
||||
"""Callback when the ihc resource changes."""
|
||||
"""Callback when the IHC resource changes."""
|
||||
self._state = value
|
||||
self.schedule_update_ha_state()
|
||||
|
@ -43,7 +43,7 @@ CONFIG_SCHEMA = vol.Schema({
|
||||
|
||||
|
||||
def setup(hass, base_config):
|
||||
"""Setup waterfurnace platform."""
|
||||
"""Set up waterfurnace platform."""
|
||||
import waterfurnace.waterfurnace as wf
|
||||
config = base_config.get(DOMAIN)
|
||||
|
||||
|
@ -87,7 +87,7 @@ class WirelessTagPlatform:
|
||||
'content': content, 'disabled': False, 'nat': True})
|
||||
|
||||
def install_push_notifications(self, binary_sensors):
|
||||
"""Setup local push notification from tag manager."""
|
||||
"""Set up local push notification from tag manager."""
|
||||
_LOGGER.info("Registering local push notifications.")
|
||||
configs = []
|
||||
|
||||
|
@ -44,7 +44,7 @@ PLATFORM_SCHEMA = vol.Schema({
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
"""Setup configured zones as well as home assistant zone if necessary."""
|
||||
"""Set up configured zones as well as home assistant zone if necessary."""
|
||||
hass.data[DOMAIN] = {}
|
||||
entities = set()
|
||||
zone_entries = configured_zones(hass)
|
||||
|
@ -411,7 +411,7 @@ class ConfigEntries:
|
||||
async def _async_create_flow(self, handler_key, *, context, data):
|
||||
"""Create a flow for specified handler.
|
||||
|
||||
Handler key is the domain of the component that we want to setup.
|
||||
Handler key is the domain of the component that we want to set up.
|
||||
"""
|
||||
component = getattr(self.hass.components, handler_key)
|
||||
handler = HANDLERS.get(handler_key)
|
||||
|
@ -159,7 +159,7 @@ async def async_load_platform(hass, component, platform, discovered=None,
|
||||
setup_success = await setup.async_setup_component(
|
||||
hass, component, hass_config)
|
||||
|
||||
# No need to fire event if we could not setup component
|
||||
# No need to fire event if we could not set up component
|
||||
if not setup_success:
|
||||
return
|
||||
|
||||
|
@ -94,7 +94,7 @@ class EntityComponent:
|
||||
self.hass, self.domain, component_platform_discovered)
|
||||
|
||||
async def async_setup_entry(self, config_entry):
|
||||
"""Setup a config entry."""
|
||||
"""Set up a config entry."""
|
||||
platform_type = config_entry.domain
|
||||
platform = await async_prepare_setup_platform(
|
||||
self.hass, self.config, self.domain, platform_type)
|
||||
|
@ -71,13 +71,13 @@ class EntityPlatform:
|
||||
self.parallel_updates = None
|
||||
|
||||
async def async_setup(self, platform_config, discovery_info=None):
|
||||
"""Setup the platform from a config file."""
|
||||
"""Set up the platform from a config file."""
|
||||
platform = self.platform
|
||||
hass = self.hass
|
||||
|
||||
@callback
|
||||
def async_create_setup_task():
|
||||
"""Get task to setup platform."""
|
||||
"""Get task to set up platform."""
|
||||
if getattr(platform, 'async_setup_platform', None):
|
||||
return platform.async_setup_platform(
|
||||
hass, platform_config,
|
||||
@ -93,21 +93,21 @@ class EntityPlatform:
|
||||
await self._async_setup_platform(async_create_setup_task)
|
||||
|
||||
async def async_setup_entry(self, config_entry):
|
||||
"""Setup the platform from a config entry."""
|
||||
"""Set up the platform from a config entry."""
|
||||
# Store it so that we can save config entry ID in entity registry
|
||||
self.config_entry = config_entry
|
||||
platform = self.platform
|
||||
|
||||
@callback
|
||||
def async_create_setup_task():
|
||||
"""Get task to setup platform."""
|
||||
"""Get task to set up platform."""
|
||||
return platform.async_setup_entry(
|
||||
self.hass, config_entry, self._async_schedule_add_entities)
|
||||
|
||||
return await self._async_setup_platform(async_create_setup_task)
|
||||
|
||||
async def _async_setup_platform(self, async_create_setup_task, tries=0):
|
||||
"""Helper to setup a platform via config file or config entry.
|
||||
"""Helper to set up a platform via config file or config entry.
|
||||
|
||||
async_create_setup_task creates a coroutine that sets up platform.
|
||||
"""
|
||||
|
@ -64,7 +64,7 @@ async def _async_process_dependencies(
|
||||
if dep in loader.DEPENDENCY_BLACKLIST]
|
||||
|
||||
if blacklisted:
|
||||
_LOGGER.error("Unable to setup dependencies of %s: "
|
||||
_LOGGER.error("Unable to set up dependencies of %s: "
|
||||
"found blacklisted dependencies: %s",
|
||||
name, ', '.join(blacklisted))
|
||||
return False
|
||||
@ -81,7 +81,7 @@ async def _async_process_dependencies(
|
||||
in enumerate(results) if not res]
|
||||
|
||||
if failed:
|
||||
_LOGGER.error("Unable to setup dependencies of %s. "
|
||||
_LOGGER.error("Unable to set up dependencies of %s. "
|
||||
"Setup failed for dependencies: %s",
|
||||
name, ', '.join(failed))
|
||||
|
||||
@ -238,7 +238,7 @@ async def async_process_deps_reqs(
|
||||
hass, config, name, module.DEPENDENCIES) # type: ignore
|
||||
|
||||
if not dep_success:
|
||||
raise HomeAssistantError("Could not setup all dependencies.")
|
||||
raise HomeAssistantError("Could not set up all dependencies.")
|
||||
|
||||
if not hass.config.skip_pip and hasattr(module, 'REQUIREMENTS'):
|
||||
req_success = await requirements.async_process_requirements(
|
||||
|
@ -22,7 +22,7 @@ class TestAlarmControlPanelManual(unittest.TestCase):
|
||||
"""Test the manual alarm module."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
|
@ -21,7 +21,7 @@ class TestAlarmControlPanelManualMqtt(unittest.TestCase):
|
||||
"""Test the manual_mqtt alarm module."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.mock_publish = mock_mqtt_component(self.hass)
|
||||
|
||||
|
@ -21,7 +21,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.mock_publish = mock_mqtt_component(self.hass)
|
||||
|
||||
|
@ -18,7 +18,7 @@ BASE_CONFIG = [{
|
||||
|
||||
async def async_setup_auth(hass, aiohttp_client, provider_configs=BASE_CONFIG,
|
||||
setup_api=False):
|
||||
"""Helper to setup authentication and create a HTTP client."""
|
||||
"""Helper to set up authentication and create an HTTP client."""
|
||||
hass.auth = await auth.auth_manager_from_config(hass, provider_configs)
|
||||
ensure_auth_manager_loaded(hass.auth)
|
||||
await async_setup_component(hass, 'auth', {
|
||||
|
@ -13,7 +13,7 @@ class TestAutomationEvent(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
self.calls = []
|
||||
|
@ -22,7 +22,7 @@ class TestAutomation(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.calls = mock_service(self.hass, 'test', 'automation')
|
||||
|
||||
|
@ -23,7 +23,7 @@ class TestLiteJetTrigger(unittest.TestCase):
|
||||
|
||||
@mock.patch('pylitejet.LiteJet')
|
||||
def setup_method(self, method, mock_pylitejet):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.start()
|
||||
|
||||
|
@ -14,7 +14,7 @@ class TestAutomationMQTT(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
mock_mqtt_component(self.hass)
|
||||
|
@ -18,7 +18,7 @@ class TestAutomationNumericState(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
self.calls = []
|
||||
|
@ -19,7 +19,7 @@ class TestAutomationState(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
self.hass.states.set('test.entity', 'hello')
|
||||
|
@ -19,7 +19,7 @@ class TestAutomationSun(unittest.TestCase):
|
||||
"""Test the sun automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
setup_component(self.hass, sun.DOMAIN, {
|
||||
|
@ -14,7 +14,7 @@ class TestAutomationTemplate(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
self.hass.states.set('test.entity', 'hello')
|
||||
|
@ -18,7 +18,7 @@ class TestAutomationTime(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
self.calls = []
|
||||
|
@ -13,7 +13,7 @@ class TestAutomationZone(unittest.TestCase):
|
||||
"""Test the event automation."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'group')
|
||||
assert setup_component(self.hass, zone.DOMAIN, {
|
||||
|
@ -12,7 +12,7 @@ class TestCommandSensorBinarySensor(unittest.TestCase):
|
||||
"""Test the Command line Binary sensor."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self):
|
||||
|
@ -11,7 +11,7 @@ class TestFFmpegNoiseSetup:
|
||||
"""Test class for ffmpeg."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
self.config = {
|
||||
@ -29,7 +29,7 @@ class TestFFmpegNoiseSetup:
|
||||
self.hass.stop()
|
||||
|
||||
def test_setup_component(self):
|
||||
"""Setup ffmpeg component."""
|
||||
"""Set up ffmpeg component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor', self.config)
|
||||
|
||||
@ -38,7 +38,7 @@ class TestFFmpegNoiseSetup:
|
||||
|
||||
@patch('haffmpeg.SensorNoise.open_sensor', return_value=mock_coro())
|
||||
def test_setup_component_start(self, mock_start):
|
||||
"""Setup ffmpeg component."""
|
||||
"""Set up ffmpeg component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor', self.config)
|
||||
|
||||
@ -53,7 +53,7 @@ class TestFFmpegNoiseSetup:
|
||||
|
||||
@patch('haffmpeg.SensorNoise')
|
||||
def test_setup_component_start_callback(self, mock_ffmpeg):
|
||||
"""Setup ffmpeg component."""
|
||||
"""Set up ffmpeg component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor', self.config)
|
||||
|
||||
@ -76,7 +76,7 @@ class TestFFmpegMotionSetup:
|
||||
"""Test class for ffmpeg."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
self.config = {
|
||||
@ -94,7 +94,7 @@ class TestFFmpegMotionSetup:
|
||||
self.hass.stop()
|
||||
|
||||
def test_setup_component(self):
|
||||
"""Setup ffmpeg component."""
|
||||
"""Set up ffmpeg component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor', self.config)
|
||||
|
||||
@ -103,7 +103,7 @@ class TestFFmpegMotionSetup:
|
||||
|
||||
@patch('haffmpeg.SensorMotion.open_sensor', return_value=mock_coro())
|
||||
def test_setup_component_start(self, mock_start):
|
||||
"""Setup ffmpeg component."""
|
||||
"""Set up ffmpeg component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor', self.config)
|
||||
|
||||
@ -118,7 +118,7 @@ class TestFFmpegMotionSetup:
|
||||
|
||||
@patch('haffmpeg.SensorMotion')
|
||||
def test_setup_component_start_callback(self, mock_ffmpeg):
|
||||
"""Setup ffmpeg component."""
|
||||
"""Set up ffmpeg component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor', self.config)
|
||||
|
||||
|
@ -16,7 +16,7 @@ class TestSensorMQTT(unittest.TestCase):
|
||||
"""Test the MQTT sensor."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_mqtt_component(self.hass)
|
||||
|
||||
|
@ -21,7 +21,7 @@ class TestNX584SensorSetup(unittest.TestCase):
|
||||
"""Test the NX584 sensor platform."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self._mock_client = mock.patch.object(nx584_client, 'Client')
|
||||
self._mock_client.start()
|
||||
|
@ -19,7 +19,7 @@ class TestRestBinarySensorSetup(unittest.TestCase):
|
||||
"""Tests for setting up the REST binary sensor platform."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self):
|
||||
@ -121,7 +121,7 @@ class TestRestBinarySensor(unittest.TestCase):
|
||||
"""Tests for REST binary sensor platform."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.rest = Mock('RestData')
|
||||
self.rest.update = Mock('RestData.update',
|
||||
|
@ -13,7 +13,7 @@ class TestTCPBinarySensor(unittest.TestCase):
|
||||
"""Test the TCP Binary Sensor."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self, method):
|
||||
|
@ -23,7 +23,7 @@ class TestBinarySensorTemplate(unittest.TestCase):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self, method):
|
||||
|
@ -16,7 +16,7 @@ class TestWorkdaySetup:
|
||||
"""Test class for workday sensor."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
# Set valid default config for test
|
||||
@ -97,7 +97,7 @@ class TestWorkdaySetup:
|
||||
self.hass.stop()
|
||||
|
||||
def test_setup_component_province(self):
|
||||
"""Setup workday component."""
|
||||
"""Set up workday component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor',
|
||||
self.config_province)
|
||||
@ -145,7 +145,7 @@ class TestWorkdaySetup:
|
||||
assert entity.state == 'off'
|
||||
|
||||
def test_setup_component_noprovince(self):
|
||||
"""Setup workday component."""
|
||||
"""Set up workday component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor',
|
||||
self.config_noprovince)
|
||||
@ -191,7 +191,7 @@ class TestWorkdaySetup:
|
||||
assert entity.state == 'on'
|
||||
|
||||
def test_setup_component_invalidprovince(self):
|
||||
"""Setup workday component."""
|
||||
"""Set up workday component."""
|
||||
with assert_setup_component(1, 'binary_sensor'):
|
||||
setup_component(self.hass, 'binary_sensor',
|
||||
self.config_invalidprovince)
|
||||
|
@ -25,7 +25,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.http = Mock()
|
||||
|
||||
|
@ -34,7 +34,7 @@ class TestSetupCamera:
|
||||
"""Test class for setup camera."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def teardown_method(self):
|
||||
@ -42,7 +42,7 @@ class TestSetupCamera:
|
||||
self.hass.stop()
|
||||
|
||||
def test_setup_component(self):
|
||||
"""Setup demo platform on camera component."""
|
||||
"""Set up demo platform on camera component."""
|
||||
config = {
|
||||
camera.DOMAIN: {
|
||||
'platform': 'demo'
|
||||
@ -57,7 +57,7 @@ class TestGetImage:
|
||||
"""Test class for camera."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
setup_component(
|
||||
|
@ -17,7 +17,7 @@ class TestUVCSetup(unittest.TestCase):
|
||||
"""Test the UVC camera platform."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self):
|
||||
@ -134,7 +134,7 @@ class TestUVCSetup(unittest.TestCase):
|
||||
@mock.patch.object(uvc, 'UnifiVideoCamera')
|
||||
@mock.patch('uvcclient.nvr.UVCRemote')
|
||||
def setup_nvr_errors_during_indexing(self, error, mock_remote, mock_uvc):
|
||||
"""Setup test for NVR errors during indexing."""
|
||||
"""Set up test for NVR errors during indexing."""
|
||||
config = {
|
||||
'platform': 'uvc',
|
||||
'nvr': 'foo',
|
||||
@ -163,7 +163,7 @@ class TestUVCSetup(unittest.TestCase):
|
||||
@mock.patch('uvcclient.nvr.UVCRemote.__init__')
|
||||
def setup_nvr_errors_during_initialization(self, error, mock_remote,
|
||||
mock_uvc):
|
||||
"""Setup test for NVR errors during initialization."""
|
||||
"""Set up test for NVR errors during initialization."""
|
||||
config = {
|
||||
'platform': 'uvc',
|
||||
'nvr': 'foo',
|
||||
@ -195,7 +195,7 @@ class TestUVC(unittest.TestCase):
|
||||
"""Test class for UVC."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup the mock camera."""
|
||||
"""Set up the mock camera."""
|
||||
self.nvr = mock.MagicMock()
|
||||
self.uuid = 'uuid'
|
||||
self.name = 'name'
|
||||
|
@ -19,7 +19,7 @@ class TestDemoClimate(unittest.TestCase):
|
||||
"""Test the demo climate hvac."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.units = METRIC_SYSTEM
|
||||
self.assertTrue(setup_component(self.hass, climate.DOMAIN, {
|
||||
|
@ -42,7 +42,7 @@ class TestSetupClimateGenericThermostat(unittest.TestCase):
|
||||
"""Test the Generic thermostat with custom config."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
@ -79,7 +79,7 @@ class TestGenericThermostatHeaterSwitching(unittest.TestCase):
|
||||
"""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.units = METRIC_SYSTEM
|
||||
self.assertTrue(run_coroutine_threadsafe(
|
||||
@ -142,7 +142,7 @@ class TestGenericThermostatHeaterSwitching(unittest.TestCase):
|
||||
self.hass.states.get(heater_switch).state)
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
@ -152,7 +152,7 @@ class TestClimateGenericThermostat(unittest.TestCase):
|
||||
"""Test the Generic thermostat."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.units = METRIC_SYSTEM
|
||||
assert setup_component(self.hass, climate.DOMAIN, {'climate': {
|
||||
@ -368,13 +368,13 @@ class TestClimateGenericThermostat(unittest.TestCase):
|
||||
self.assertEqual(ENT_SWITCH, call.data['entity_id'])
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
|
||||
def _setup_switch(self, is_on):
|
||||
"""Setup the test switch."""
|
||||
"""Set up the test switch."""
|
||||
self.hass.states.set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
|
||||
self.calls = []
|
||||
|
||||
@ -391,7 +391,7 @@ class TestClimateGenericThermostatACMode(unittest.TestCase):
|
||||
"""Test the Generic thermostat."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
assert setup_component(self.hass, climate.DOMAIN, {'climate': {
|
||||
@ -533,13 +533,13 @@ class TestClimateGenericThermostatACMode(unittest.TestCase):
|
||||
self.assertEqual(0, len(self.calls))
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
|
||||
def _setup_switch(self, is_on):
|
||||
"""Setup the test switch."""
|
||||
"""Set up the test switch."""
|
||||
self.hass.states.set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
|
||||
self.calls = []
|
||||
|
||||
@ -556,7 +556,7 @@ class TestClimateGenericThermostatACModeMinCycle(unittest.TestCase):
|
||||
"""Test the Generic Thermostat."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
assert setup_component(self.hass, climate.DOMAIN, {'climate': {
|
||||
@ -627,13 +627,13 @@ class TestClimateGenericThermostatACModeMinCycle(unittest.TestCase):
|
||||
self.assertEqual(ENT_SWITCH, call.data['entity_id'])
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
|
||||
def _setup_switch(self, is_on):
|
||||
"""Setup the test switch."""
|
||||
"""Set up the test switch."""
|
||||
self.hass.states.set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
|
||||
self.calls = []
|
||||
|
||||
@ -650,7 +650,7 @@ class TestClimateGenericThermostatMinCycle(unittest.TestCase):
|
||||
"""Test the Generic thermostat."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
assert setup_component(self.hass, climate.DOMAIN, {'climate': {
|
||||
@ -720,13 +720,13 @@ class TestClimateGenericThermostatMinCycle(unittest.TestCase):
|
||||
self.assertEqual(ENT_SWITCH, call.data['entity_id'])
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
|
||||
def _setup_switch(self, is_on):
|
||||
"""Setup the test switch."""
|
||||
"""Set up the test switch."""
|
||||
self.hass.states.set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
|
||||
self.calls = []
|
||||
|
||||
@ -743,7 +743,7 @@ class TestClimateGenericThermostatACKeepAlive(unittest.TestCase):
|
||||
"""Test the Generic Thermostat."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
assert setup_component(self.hass, climate.DOMAIN, {'climate': {
|
||||
@ -813,13 +813,13 @@ class TestClimateGenericThermostatACKeepAlive(unittest.TestCase):
|
||||
self.hass.bus.fire(ha.EVENT_TIME_CHANGED, {ha.ATTR_NOW: now})
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
|
||||
def _setup_switch(self, is_on):
|
||||
"""Setup the test switch."""
|
||||
"""Set up the test switch."""
|
||||
self.hass.states.set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
|
||||
self.calls = []
|
||||
|
||||
@ -836,7 +836,7 @@ class TestClimateGenericThermostatKeepAlive(unittest.TestCase):
|
||||
"""Test the Generic Thermostat."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
assert setup_component(self.hass, climate.DOMAIN, {'climate': {
|
||||
@ -905,13 +905,13 @@ class TestClimateGenericThermostatKeepAlive(unittest.TestCase):
|
||||
self.hass.bus.fire(ha.EVENT_TIME_CHANGED, {ha.ATTR_NOW: now})
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
|
||||
def _setup_switch(self, is_on):
|
||||
"""Setup the test switch."""
|
||||
"""Set up the test switch."""
|
||||
self.hass.states.set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
|
||||
self.calls = []
|
||||
|
||||
@ -999,7 +999,7 @@ class TestClimateGenericThermostatRestoreState(unittest.TestCase):
|
||||
"""Test generic thermostat when restore state from HA startup."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
|
||||
@ -1048,13 +1048,13 @@ class TestClimateGenericThermostatRestoreState(unittest.TestCase):
|
||||
}})
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
"""Set up the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
})
|
||||
|
||||
def _setup_switch(self, is_on):
|
||||
"""Setup the test switch."""
|
||||
"""Set up the test switch."""
|
||||
self.hass.states.set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
|
||||
self.calls = []
|
||||
|
||||
|
@ -35,7 +35,7 @@ class TestMQTTClimate(unittest.TestCase):
|
||||
"""Test the mqtt climate hvac."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.mock_publish = mock_mqtt_component(self.hass)
|
||||
self.hass.config.units = METRIC_SYSTEM
|
||||
|
@ -17,7 +17,7 @@ class TestCommandCover(unittest.TestCase):
|
||||
"""Test the cover command line platform."""
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.rs = cmd_rs.CommandCover(self.hass, 'foo',
|
||||
'command_open', 'command_close',
|
||||
|
@ -14,7 +14,7 @@ class TestCoverDemo(unittest.TestCase):
|
||||
"""Test the Demo cover."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.assertTrue(setup_component(self.hass, cover.DOMAIN, {'cover': {
|
||||
'platform': 'demo',
|
||||
|
@ -35,7 +35,7 @@ class TestMultiCover(unittest.TestCase):
|
||||
"""Test the group cover platform."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self):
|
||||
|
@ -15,7 +15,7 @@ class TestCoverMQTT(unittest.TestCase):
|
||||
"""Test the MQTT cover."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.mock_publish = mock_mqtt_component(self.hass)
|
||||
|
||||
|
@ -14,7 +14,7 @@ class TestCoverRfxtrx(unittest.TestCase):
|
||||
"""Test the Rfxtrx cover platform."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component('rfxtrx')
|
||||
|
||||
|
@ -116,7 +116,7 @@ WAKE_DEVICES_NO_IP = {
|
||||
|
||||
|
||||
def setup_module():
|
||||
"""Setup the test module."""
|
||||
"""Set up the test module."""
|
||||
global FAKEFILE
|
||||
FAKEFILE = get_test_config_dir('fake_file')
|
||||
with open(FAKEFILE, 'w') as out:
|
||||
@ -138,7 +138,7 @@ class TestComponentsDeviceTrackerASUSWRT(unittest.TestCase):
|
||||
hass = None
|
||||
|
||||
def setup_method(self, _):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'zone')
|
||||
|
||||
@ -500,7 +500,7 @@ class TestSshConnection(unittest.TestCase):
|
||||
"""Testing SshConnection."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup test env."""
|
||||
"""Set up test env."""
|
||||
self.connection = SshConnection(
|
||||
'fake', 'fake', 'fake', 'fake', 'fake')
|
||||
self.connection._connected = True
|
||||
@ -544,7 +544,7 @@ class TestTelnetConnection(unittest.TestCase):
|
||||
"""Testing TelnetConnection."""
|
||||
|
||||
def setUp(self):
|
||||
"""Setup test env."""
|
||||
"""Set up test env."""
|
||||
self.connection = TelnetConnection(
|
||||
'fake', 'fake', 'fake', 'fake')
|
||||
self.connection._connected = True
|
||||
|
@ -41,7 +41,7 @@ class TestDdwrt(unittest.TestCase):
|
||||
super().run(result)
|
||||
|
||||
def setup_method(self, _):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'zone')
|
||||
|
||||
@ -220,7 +220,7 @@ class TestDdwrt(unittest.TestCase):
|
||||
with requests_mock.Mocker() as mock_request:
|
||||
mock_request.register_uri(
|
||||
'GET', r'http://%s/Status_Wireless.live.asp' % TEST_HOST,
|
||||
# First request has to work to setup connection
|
||||
# First request has to work to set up connection
|
||||
[{'text': load_fixture('Ddwrt_Status_Wireless.txt')},
|
||||
# Second request to get active devices fails
|
||||
{'text': None}])
|
||||
|
@ -122,7 +122,7 @@ def geofency_client(loop, hass, aiohttp_client):
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_zones(loop, hass):
|
||||
"""Setup Zone config in HA."""
|
||||
"""Set up Zone config in HA."""
|
||||
assert loop.run_until_complete(async_setup_component(
|
||||
hass, zone.DOMAIN, {
|
||||
'zone': {
|
||||
|
@ -39,7 +39,7 @@ class TestComponentsDeviceTracker(unittest.TestCase):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.yaml_devices = self.hass.config.path(device_tracker.YAML_DEVICES)
|
||||
|
||||
|
@ -19,7 +19,7 @@ class TestComponentsDeviceTrackerMQTT(unittest.TestCase):
|
||||
"""Test MQTT device tracker platform."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_mqtt_component(self.hass)
|
||||
|
||||
|
@ -29,7 +29,7 @@ class TestComponentsDeviceTrackerJSONMQTT(unittest.TestCase):
|
||||
"""Test JSON MQTT device tracker platform."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_mqtt_component(self.hass)
|
||||
|
||||
|
@ -327,7 +327,7 @@ class TestDeviceTrackerOwnTracks(BaseMQTT):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
def setup_method(self, _):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_mqtt_component(self.hass)
|
||||
mock_component(self.hass, 'group')
|
||||
@ -1316,7 +1316,7 @@ class TestDeviceTrackerOwnTrackConfigs(BaseMQTT):
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_mqtt_component(self.hass)
|
||||
mock_component(self.hass, 'group')
|
||||
|
@ -16,7 +16,7 @@ class TestTplink4DeviceScanner(unittest.TestCase):
|
||||
"""Tests for the Tplink4DeviceScanner class."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
|
@ -31,7 +31,7 @@ class TestComponentsDeviceTrackerUnifiDirect(unittest.TestCase):
|
||||
'unifi_direct.UnifiDeviceScanner'
|
||||
|
||||
def setup_method(self, _):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'zone')
|
||||
|
||||
|
@ -37,7 +37,7 @@ class TestUPCConnect:
|
||||
"""Tests for the Ddwrt device tracker platform."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
mock_component(self.hass, 'zone')
|
||||
mock_component(self.hass, 'group')
|
||||
@ -52,7 +52,7 @@ class TestUPCConnect:
|
||||
'UPCDeviceScanner.async_scan_devices',
|
||||
return_value=async_scan_devices_mock)
|
||||
def test_setup_platform(self, scan_mock, aioclient_mock):
|
||||
"""Setup a platform."""
|
||||
"""Set up a platform."""
|
||||
aioclient_mock.get(
|
||||
"http://{}/common_page/login.html".format(self.host),
|
||||
cookies={'sessionToken': '654321'}
|
||||
@ -74,7 +74,7 @@ class TestUPCConnect:
|
||||
@patch('homeassistant.components.device_tracker._LOGGER.error')
|
||||
def test_setup_platform_timeout_webservice(self, mock_error,
|
||||
aioclient_mock):
|
||||
"""Setup a platform with api timeout."""
|
||||
"""Set up a platform with api timeout."""
|
||||
aioclient_mock.get(
|
||||
"http://{}/common_page/login.html".format(self.host),
|
||||
cookies={'sessionToken': '654321'},
|
||||
@ -97,7 +97,7 @@ class TestUPCConnect:
|
||||
@patch('homeassistant.components.device_tracker._LOGGER.error')
|
||||
def test_setup_platform_timeout_loginpage(self, mock_error,
|
||||
aioclient_mock):
|
||||
"""Setup a platform with timeout on loginpage."""
|
||||
"""Set up a platform with timeout on loginpage."""
|
||||
aioclient_mock.get(
|
||||
"http://{}/common_page/login.html".format(self.host),
|
||||
exc=asyncio.TimeoutError()
|
||||
@ -120,7 +120,7 @@ class TestUPCConnect:
|
||||
str(mock_error.call_args_list[-1])
|
||||
|
||||
def test_scan_devices(self, aioclient_mock):
|
||||
"""Setup a upc platform and scan device."""
|
||||
"""Set up a upc platform and scan device."""
|
||||
aioclient_mock.get(
|
||||
"http://{}/common_page/login.html".format(self.host),
|
||||
cookies={'sessionToken': '654321'}
|
||||
@ -156,7 +156,7 @@ class TestUPCConnect:
|
||||
'70:EE:50:27:A1:38']
|
||||
|
||||
def test_scan_devices_without_session(self, aioclient_mock):
|
||||
"""Setup a upc platform and scan device with no token."""
|
||||
"""Set up a upc platform and scan device with no token."""
|
||||
aioclient_mock.get(
|
||||
"http://{}/common_page/login.html".format(self.host),
|
||||
cookies={'sessionToken': '654321'}
|
||||
@ -197,7 +197,7 @@ class TestUPCConnect:
|
||||
'70:EE:50:27:A1:38']
|
||||
|
||||
def test_scan_devices_without_session_wrong_re(self, aioclient_mock):
|
||||
"""Setup a upc platform and scan device with no token and wrong."""
|
||||
"""Set up a upc platform and scan device with no token and wrong."""
|
||||
aioclient_mock.get(
|
||||
"http://{}/common_page/login.html".format(self.host),
|
||||
cookies={'sessionToken': '654321'}
|
||||
@ -237,7 +237,7 @@ class TestUPCConnect:
|
||||
assert mac_list == []
|
||||
|
||||
def test_scan_devices_parse_error(self, aioclient_mock):
|
||||
"""Setup a upc platform and scan device with parse error."""
|
||||
"""Set up a upc platform and scan device with parse error."""
|
||||
aioclient_mock.get(
|
||||
"http://{}/common_page/login.html".format(self.host),
|
||||
cookies={'sessionToken': '654321'}
|
||||
|
@ -26,7 +26,7 @@ JSON_HEADERS = {CONTENT_TYPE: const.CONTENT_TYPE_JSON}
|
||||
|
||||
@pytest.fixture
|
||||
def hass_hue(loop, hass):
|
||||
"""Setup a Home Assistant instance for these tests."""
|
||||
"""Set up a Home Assistant instance for these tests."""
|
||||
# We need to do this to get access to homeassistant/turn_(on,off)
|
||||
loop.run_until_complete(
|
||||
core_components.async_setup(hass, {core.DOMAIN: {}}))
|
||||
|
@ -50,7 +50,7 @@ class TestEmulatedHue(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Setup the class."""
|
||||
"""Set up the class."""
|
||||
cls.hass = hass = get_test_home_assistant()
|
||||
|
||||
# We need to do this to get access to homeassistant/turn_(on,off)
|
||||
|
@ -68,7 +68,7 @@ class DysonTest(unittest.TestCase):
|
||||
"""Dyson Sensor component test class."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
|
@ -13,7 +13,7 @@ class TestMqttFan(unittest.TestCase):
|
||||
"""Test the MQTT fan platform."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.mock_publish = mock_mqtt_component(self.hass)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class TestTemplateFan:
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
def setup_method(self, method):
|
||||
"""Setup."""
|
||||
"""Set up."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
self.calls = []
|
||||
|
@ -19,7 +19,7 @@ class TestComponentsGroup(unittest.TestCase):
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
@ -28,7 +28,7 @@ class TestComponentsGroup(unittest.TestCase):
|
||||
self.hass.stop()
|
||||
|
||||
def test_setup_group_with_mixed_groupable_states(self):
|
||||
"""Try to setup a group with mixed groupable states."""
|
||||
"""Try to set up a group with mixed groupable states."""
|
||||
self.hass.states.set('light.Bowl', STATE_ON)
|
||||
self.hass.states.set('device_tracker.Paulus', STATE_HOME)
|
||||
group.Group.create_group(
|
||||
@ -41,7 +41,7 @@ class TestComponentsGroup(unittest.TestCase):
|
||||
group.ENTITY_ID_FORMAT.format('person_and_light')).state)
|
||||
|
||||
def test_setup_group_with_a_non_existing_state(self):
|
||||
"""Try to setup a group with a non existing state."""
|
||||
"""Try to set up a group with a non existing state."""
|
||||
self.hass.states.set('light.Bowl', STATE_ON)
|
||||
|
||||
grp = group.Group.create_group(
|
||||
@ -62,7 +62,7 @@ class TestComponentsGroup(unittest.TestCase):
|
||||
self.assertEqual(STATE_UNKNOWN, grp.state)
|
||||
|
||||
def test_setup_empty_group(self):
|
||||
"""Try to setup an empty group."""
|
||||
"""Try to set up an empty group."""
|
||||
grp = group.Group.create_group(self.hass, 'nothing', [])
|
||||
|
||||
self.assertEqual(STATE_UNKNOWN, grp.state)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user