mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix typos found by codespell (#31243)
* Fix typos found by codespell * Fix typos found by codespell * codespell: Furture ==> Future * Update test_config_flow.py * Update __init__.py * Spellcheck: successfull ==> successful * Codespell: unsuccesful ==> unsuccessful * Codespell: cant ==> can't * Codespell: firware ==> firmware * Codespell: mimick ==> mimic
This commit is contained in:
parent
a017c26234
commit
df7d2b3aeb
@ -14,6 +14,15 @@ repos:
|
|||||||
- --safe
|
- --safe
|
||||||
- --quiet
|
- --quiet
|
||||||
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$
|
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$
|
||||||
|
- repo: https://github.com/codespell-project/codespell
|
||||||
|
rev: v1.16.0
|
||||||
|
hooks:
|
||||||
|
- id: codespell
|
||||||
|
args:
|
||||||
|
- --ignore-words-list=hass,alot,datas,dof,dur,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing
|
||||||
|
- --skip="./.*,*.json"
|
||||||
|
- --quiet-level=2
|
||||||
|
exclude_types: [json]
|
||||||
- repo: https://gitlab.com/pycqa/flake8
|
- repo: https://gitlab.com/pycqa/flake8
|
||||||
rev: 3.7.9
|
rev: 3.7.9
|
||||||
hooks:
|
hooks:
|
||||||
|
@ -44,6 +44,10 @@ stages:
|
|||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
|
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
|
||||||
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
||||||
|
- script: |
|
||||||
|
. venv/bin/activate
|
||||||
|
pre-commit run codespell --all-files
|
||||||
|
displayName: 'Run codespell'
|
||||||
- script: |
|
- script: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pre-commit run flake8 --all-files
|
pre-commit run flake8 --all-files
|
||||||
|
@ -163,7 +163,7 @@ stages:
|
|||||||
|
|
||||||
git commit -am "Bump Home Assistant $version"
|
git commit -am "Bump Home Assistant $version"
|
||||||
git push
|
git push
|
||||||
displayName: 'Update version files'
|
displayName: "Update version files"
|
||||||
- job: 'ReleaseDocker'
|
- job: 'ReleaseDocker'
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
@ -301,7 +301,7 @@ class AuthManager:
|
|||||||
async def async_deactivate_user(self, user: models.User) -> None:
|
async def async_deactivate_user(self, user: models.User) -> None:
|
||||||
"""Deactivate a user."""
|
"""Deactivate a user."""
|
||||||
if user.is_owner:
|
if user.is_owner:
|
||||||
raise ValueError("Unable to deactive the owner")
|
raise ValueError("Unable to deactivate the owner")
|
||||||
await self._store.async_deactivate_user(user)
|
await self._store.async_deactivate_user(user)
|
||||||
|
|
||||||
async def async_remove_credentials(self, credentials: models.Credentials) -> None:
|
async def async_remove_credentials(self, credentials: models.Credentials) -> None:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Plugable auth modules for Home Assistant."""
|
"""Pluggable auth modules for Home Assistant."""
|
||||||
import importlib
|
import importlib
|
||||||
import logging
|
import logging
|
||||||
import types
|
import types
|
||||||
|
@ -317,7 +317,7 @@ class NotifySetupFlow(SetupFlow):
|
|||||||
async def async_step_setup(
|
async def async_step_setup(
|
||||||
self, user_input: Optional[Dict[str, str]] = None
|
self, user_input: Optional[Dict[str, str]] = None
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
"""Verify user can recevie one-time password."""
|
"""Verify user can receive one-time password."""
|
||||||
errors: Dict[str, str] = {}
|
errors: Dict[str, str] = {}
|
||||||
|
|
||||||
hass = self._auth_module.hass
|
hass = self._auth_module.hass
|
||||||
|
@ -193,7 +193,7 @@ def async_enable_logging(
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# If the above initialization failed for any reason, setup the default
|
# If the above initialization failed for any reason, setup the default
|
||||||
# formatting. If the above succeeds, this wil result in a no-op.
|
# formatting. If the above succeeds, this will result in a no-op.
|
||||||
logging.basicConfig(format=fmt, datefmt=datefmt, level=logging.INFO)
|
logging.basicConfig(format=fmt, datefmt=datefmt, level=logging.INFO)
|
||||||
|
|
||||||
# Suppress overly verbose logs from libraries that aren't helpful
|
# Suppress overly verbose logs from libraries that aren't helpful
|
||||||
|
@ -43,7 +43,7 @@ class AlexaDirective:
|
|||||||
Behavior when self.has_endpoint is False is undefined.
|
Behavior when self.has_endpoint is False is undefined.
|
||||||
|
|
||||||
Will raise AlexaInvalidEndpointError if the endpoint in the request is
|
Will raise AlexaInvalidEndpointError if the endpoint in the request is
|
||||||
malformed or nonexistant.
|
malformed or nonexistent.
|
||||||
"""
|
"""
|
||||||
_endpoint_id = self._directive[API_ENDPOINT]["endpointId"]
|
_endpoint_id = self._directive[API_ENDPOINT]["endpointId"]
|
||||||
self.entity_id = _endpoint_id.replace("#", ".")
|
self.entity_id = _endpoint_id.replace("#", ".")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Suppoort for Amcrest IP camera binary sensors."""
|
"""Support for Amcrest IP camera binary sensors."""
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ class AmcrestCam(Camera):
|
|||||||
available = self.available
|
available = self.available
|
||||||
if not available or not self.is_on:
|
if not available or not self.is_on:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Attempt to take snaphot when %s camera is %s",
|
"Attempt to take snapshot when %s camera is %s",
|
||||||
self.name,
|
self.name,
|
||||||
"offline" if not available else "off",
|
"offline" if not available else "off",
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Suppoort for Amcrest IP camera sensors."""
|
"""Support for Amcrest IP camera sensors."""
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ class ApnsNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
def device_state_changed_listener(self, entity_id, from_s, to_s):
|
def device_state_changed_listener(self, entity_id, from_s, to_s):
|
||||||
"""
|
"""
|
||||||
Listen for sate change.
|
Listen for state change.
|
||||||
|
|
||||||
Track device state change if a device has a tracking id specified.
|
Track device state change if a device has a tracking id specified.
|
||||||
"""
|
"""
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Implemenet device conditions for binary sensor."""
|
"""Implement device conditions for binary sensor."""
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -421,7 +421,7 @@ class BluesoundPlayer(MediaPlayerDevice):
|
|||||||
# sync_status. We will force an update if the player is
|
# sync_status. We will force an update if the player is
|
||||||
# grouped this isn't a foolproof solution. A better
|
# grouped this isn't a foolproof solution. A better
|
||||||
# solution would be to fetch sync_status more often when
|
# solution would be to fetch sync_status more often when
|
||||||
# the device is playing. This would solve alot of
|
# the device is playing. This would solve a lot of
|
||||||
# problems. This change will be done when the
|
# problems. This change will be done when the
|
||||||
# communication is moved to a separate library
|
# communication is moved to a separate library
|
||||||
await self.force_update_sync_status()
|
await self.force_update_sync_status()
|
||||||
|
@ -281,7 +281,7 @@ def _get_bom_stations():
|
|||||||
"""Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.
|
"""Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.
|
||||||
|
|
||||||
This function does several MB of internet requests, so please use the
|
This function does several MB of internet requests, so please use the
|
||||||
caching version to minimise latency and hit-count.
|
caching version to minimize latency and hit-count.
|
||||||
"""
|
"""
|
||||||
latlon = {}
|
latlon = {}
|
||||||
with io.BytesIO() as file_obj:
|
with io.BytesIO() as file_obj:
|
||||||
|
@ -270,7 +270,7 @@ class BroadlinkRemote(RemoteDevice):
|
|||||||
async def _async_learn_code(self, command, device, toggle, timeout):
|
async def _async_learn_code(self, command, device, toggle, timeout):
|
||||||
"""Learn a code from a remote.
|
"""Learn a code from a remote.
|
||||||
|
|
||||||
Capture an aditional code for toggle commands.
|
Capture an additional code for toggle commands.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if not toggle:
|
if not toggle:
|
||||||
|
@ -377,7 +377,7 @@ class Camera(Entity):
|
|||||||
async def handle_async_mjpeg_stream(self, request):
|
async def handle_async_mjpeg_stream(self, request):
|
||||||
"""Serve an HTTP MJPEG stream from the camera.
|
"""Serve an HTTP MJPEG stream from the camera.
|
||||||
|
|
||||||
This method can be overridden by camera plaforms to proxy
|
This method can be overridden by camera platforms to proxy
|
||||||
a direct stream from the camera.
|
a direct stream from the camera.
|
||||||
"""
|
"""
|
||||||
return await self.handle_async_still_stream(request, self.frame_interval)
|
return await self.handle_async_still_stream(request, self.frame_interval)
|
||||||
|
@ -69,7 +69,7 @@ class CertexpiryConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None):
|
async def async_step_user(self, user_input=None):
|
||||||
"""Step when user intializes a integration."""
|
"""Step when user initializes a integration."""
|
||||||
self._errors = {}
|
self._errors = {}
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
# set some defaults in case we need to return to the form
|
# set some defaults in case we need to return to the form
|
||||||
|
@ -30,7 +30,7 @@ set_temperature:
|
|||||||
description: New target temperature for HVAC.
|
description: New target temperature for HVAC.
|
||||||
example: 25
|
example: 25
|
||||||
target_temp_high:
|
target_temp_high:
|
||||||
description: New target high tempereature for HVAC.
|
description: New target high temperature for HVAC.
|
||||||
example: 26
|
example: 26
|
||||||
target_temp_low:
|
target_temp_low:
|
||||||
description: New target low temperature for HVAC.
|
description: New target low temperature for HVAC.
|
||||||
|
@ -209,7 +209,7 @@ class Configurator:
|
|||||||
entity_id = self._requests.pop(request_id)[0]
|
entity_id = self._requests.pop(request_id)[0]
|
||||||
|
|
||||||
# If we remove the state right away, it will not be included with
|
# If we remove the state right away, it will not be included with
|
||||||
# the result fo the service call (current design limitation).
|
# the result of the service call (current design limitation).
|
||||||
# Instead, we will set it to configured to give as feedback but delete
|
# Instead, we will set it to configured to give as feedback but delete
|
||||||
# it shortly after so that it is deleted when the client updates.
|
# it shortly after so that it is deleted when the client updates.
|
||||||
self.hass.states.async_set(entity_id, STATE_CONFIGURED)
|
self.hass.states.async_set(entity_id, STATE_CONFIGURED)
|
||||||
|
@ -720,7 +720,7 @@ def create_hue_success_response(entity_id, attr, value):
|
|||||||
|
|
||||||
|
|
||||||
def create_list_of_entities(config, request):
|
def create_list_of_entities(config, request):
|
||||||
"""Create a list of all entites."""
|
"""Create a list of all entities."""
|
||||||
hass = request.app["hass"]
|
hass = request.app["hass"]
|
||||||
json_response = {}
|
json_response = {}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class EmulatedRoku:
|
|||||||
)
|
)
|
||||||
|
|
||||||
LOGGER.debug(
|
LOGGER.debug(
|
||||||
"Intializing emulated_roku %s on %s:%s",
|
"Initializing emulated_roku %s on %s:%s",
|
||||||
self.roku_usn,
|
self.roku_usn,
|
||||||
self.host_ip,
|
self.host_ip,
|
||||||
self.listen_port,
|
self.listen_port,
|
||||||
|
@ -148,7 +148,7 @@ def _handle_exception(err) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
except aiohttp.ClientConnectionError:
|
except aiohttp.ClientConnectionError:
|
||||||
# this appears to be a common occurance with the vendor's servers
|
# this appears to be a common occurrence with the vendor's servers
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Unable to connect with the vendor's server. "
|
"Unable to connect with the vendor's server. "
|
||||||
"Check your network and the vendor's service status page. "
|
"Check your network and the vendor's service status page. "
|
||||||
@ -184,7 +184,7 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
|||||||
tokens = dict(app_storage if app_storage else {})
|
tokens = dict(app_storage if app_storage else {})
|
||||||
|
|
||||||
if tokens.pop(CONF_USERNAME, None) != config[DOMAIN][CONF_USERNAME]:
|
if tokens.pop(CONF_USERNAME, None) != config[DOMAIN][CONF_USERNAME]:
|
||||||
# any tokens wont be valid, and store might be be corrupt
|
# any tokens won't be valid, and store might be be corrupt
|
||||||
await store.async_save({})
|
await store.async_save({})
|
||||||
return ({}, None)
|
return ({}, None)
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ def setup_service_functions(hass: HomeAssistantType, broker):
|
|||||||
|
|
||||||
Not all Honeywell TCC-compatible systems support all operating modes. In addition,
|
Not all Honeywell TCC-compatible systems support all operating modes. In addition,
|
||||||
each mode will require any of four distinct service schemas. This has to be
|
each mode will require any of four distinct service schemas. This has to be
|
||||||
enumerated before registering the approperiate handlers.
|
enumerated before registering the appropriate handlers.
|
||||||
|
|
||||||
It appears that all TCC-compatible systems support the same three zones modes.
|
It appears that all TCC-compatible systems support the same three zones modes.
|
||||||
"""
|
"""
|
||||||
|
@ -169,7 +169,7 @@ class FanEntity(ToggleEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def capability_attributes(self):
|
def capability_attributes(self):
|
||||||
"""Return capabilitiy attributes."""
|
"""Return capability attributes."""
|
||||||
return {ATTR_SPEED_LIST: self.speed_list}
|
return {ATTR_SPEED_LIST: self.speed_list}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -68,7 +68,7 @@ class FibaroLight(FibaroDevice, Light):
|
|||||||
supports_dimming = "levelChange" in fibaro_device.interfaces
|
supports_dimming = "levelChange" in fibaro_device.interfaces
|
||||||
supports_white_v = "setW" in fibaro_device.actions
|
supports_white_v = "setW" in fibaro_device.actions
|
||||||
|
|
||||||
# Configuration can overrride default capability detection
|
# Configuration can override default capability detection
|
||||||
if devconf.get(CONF_DIMMING, supports_dimming):
|
if devconf.get(CONF_DIMMING, supports_dimming):
|
||||||
self._supported_flags |= SUPPORT_BRIGHTNESS
|
self._supported_flags |= SUPPORT_BRIGHTNESS
|
||||||
if devconf.get(CONF_COLOR, supports_color):
|
if devconf.get(CONF_COLOR, supports_color):
|
||||||
|
@ -377,7 +377,7 @@ class Filter:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def skip_processing(self):
|
def skip_processing(self):
|
||||||
"""Return wether the current filter_state should be skipped."""
|
"""Return whether the current filter_state should be skipped."""
|
||||||
return self._skip_processing
|
return self._skip_processing
|
||||||
|
|
||||||
def _filter_state(self, new_state):
|
def _filter_state(self, new_state):
|
||||||
|
@ -18,7 +18,7 @@ class FbxWifiSwitch(SwitchDevice):
|
|||||||
"""Representation of a freebox wifi switch."""
|
"""Representation of a freebox wifi switch."""
|
||||||
|
|
||||||
def __init__(self, fbx):
|
def __init__(self, fbx):
|
||||||
"""Initilize the Wifi switch."""
|
"""Initialize the Wifi switch."""
|
||||||
self._name = "Freebox WiFi"
|
self._name = "Freebox WiFi"
|
||||||
self._state = None
|
self._state = None
|
||||||
self._fbx = fbx
|
self._fbx = fbx
|
||||||
|
@ -43,13 +43,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|||||||
GarminConnectAuthenticationError,
|
GarminConnectAuthenticationError,
|
||||||
GarminConnectTooManyRequestsError,
|
GarminConnectTooManyRequestsError,
|
||||||
) as err:
|
) as err:
|
||||||
_LOGGER.error("Error occured during Garmin Connect login: %s", err)
|
_LOGGER.error("Error occurred during Garmin Connect login: %s", err)
|
||||||
return False
|
return False
|
||||||
except (GarminConnectConnectionError) as err:
|
except (GarminConnectConnectionError) as err:
|
||||||
_LOGGER.error("Error occured during Garmin Connect login: %s", err)
|
_LOGGER.error("Error occurred during Garmin Connect login: %s", err)
|
||||||
raise ConfigEntryNotReady
|
raise ConfigEntryNotReady
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception: # pylint: disable=broad-except
|
||||||
_LOGGER.error("Unknown error occured during Garmin Connect login")
|
_LOGGER.error("Unknown error occurred during Garmin Connect login")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
garmin_data = GarminConnectData(hass, garmin_client)
|
garmin_data = GarminConnectData(hass, garmin_client)
|
||||||
@ -98,11 +98,11 @@ class GarminConnectData:
|
|||||||
GarminConnectAuthenticationError,
|
GarminConnectAuthenticationError,
|
||||||
GarminConnectTooManyRequestsError,
|
GarminConnectTooManyRequestsError,
|
||||||
) as err:
|
) as err:
|
||||||
_LOGGER.error("Error occured during Garmin Connect get stats: %s", err)
|
_LOGGER.error("Error occurred during Garmin Connect get stats: %s", err)
|
||||||
return
|
return
|
||||||
except (GarminConnectConnectionError) as err:
|
except (GarminConnectConnectionError) as err:
|
||||||
_LOGGER.error("Error occured during Garmin Connect get stats: %s", err)
|
_LOGGER.error("Error occurred during Garmin Connect get stats: %s", err)
|
||||||
return
|
return
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception: # pylint: disable=broad-except
|
||||||
_LOGGER.error("Unknown error occured during Garmin Connect get stats")
|
_LOGGER.error("Unknown error occurred during Garmin Connect get stats")
|
||||||
return
|
return
|
||||||
|
@ -32,9 +32,9 @@ async def async_setup_entry(
|
|||||||
GarminConnectAuthenticationError,
|
GarminConnectAuthenticationError,
|
||||||
GarminConnectTooManyRequestsError,
|
GarminConnectTooManyRequestsError,
|
||||||
) as err:
|
) as err:
|
||||||
_LOGGER.error("Error occured during Garmin Connect Client update: %s", err)
|
_LOGGER.error("Error occurred during Garmin Connect Client update: %s", err)
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception: # pylint: disable=broad-except
|
||||||
_LOGGER.error("Unknown error occured during Garmin Connect Client update.")
|
_LOGGER.error("Unknown error occurred during Garmin Connect Client update.")
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
for (
|
for (
|
||||||
|
@ -180,7 +180,7 @@ class GoogleConfig(AbstractConfig):
|
|||||||
return 500
|
return 500
|
||||||
|
|
||||||
async def async_call_homegraph_api(self, url, data):
|
async def async_call_homegraph_api(self, url, data):
|
||||||
"""Call a homegraph api with authenticaiton."""
|
"""Call a homegraph api with authentication."""
|
||||||
session = async_get_clientsession(self.hass)
|
session = async_get_clientsession(self.hass)
|
||||||
|
|
||||||
async def _call():
|
async def _call():
|
||||||
|
@ -3,7 +3,7 @@ select_device:
|
|||||||
description: Select HDMI device.
|
description: Select HDMI device.
|
||||||
fields:
|
fields:
|
||||||
device: {description: 'Address of device to select. Can be entity_id, physical
|
device: {description: 'Address of device to select. Can be entity_id, physical
|
||||||
address or alias from confuguration.', example: '"switch.hdmi_1" or "1.1.0.0"
|
address or alias from configuration.', example: '"switch.hdmi_1" or "1.1.0.0"
|
||||||
or "01:10"'}
|
or "01:10"'}
|
||||||
send_command:
|
send_command:
|
||||||
description: Sends CEC command into HDMI CEC capable adapter.
|
description: Sends CEC command into HDMI CEC capable adapter.
|
||||||
|
@ -201,7 +201,7 @@ class Light(HomeAccessory):
|
|||||||
# But if it is set to 0, HomeKit will update the brightness to 100 as
|
# But if it is set to 0, HomeKit will update the brightness to 100 as
|
||||||
# it thinks 0 is off.
|
# it thinks 0 is off.
|
||||||
#
|
#
|
||||||
# Therefore, if the the brighness is 0 and the device is still on,
|
# Therefore, if the the brightness is 0 and the device is still on,
|
||||||
# the brightness is mapped to 1 otherwise the update is ignored in
|
# the brightness is mapped to 1 otherwise the update is ignored in
|
||||||
# order to avoid this incorrect behavior.
|
# order to avoid this incorrect behavior.
|
||||||
if brightness == 0:
|
if brightness == 0:
|
||||||
|
@ -63,7 +63,7 @@ class HomeKitEntity(Entity):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""Configure an entity baed on its HomeKit characterstics metadata."""
|
"""Configure an entity baed on its HomeKit characteristics metadata."""
|
||||||
accessories = self._accessory.accessories
|
accessories = self._accessory.accessories
|
||||||
|
|
||||||
get_uuid = CharacteristicsTypes.get_uuid
|
get_uuid = CharacteristicsTypes.get_uuid
|
||||||
@ -124,7 +124,7 @@ class HomeKitEntity(Entity):
|
|||||||
"""Collect new data from bridge and update the entity state in hass."""
|
"""Collect new data from bridge and update the entity state in hass."""
|
||||||
accessory_state = self._accessory.current_state.get(self._aid, {})
|
accessory_state = self._accessory.current_state.get(self._aid, {})
|
||||||
for iid, result in accessory_state.items():
|
for iid, result in accessory_state.items():
|
||||||
# No value so dont process this result
|
# No value so don't process this result
|
||||||
if "value" not in result:
|
if "value" not in result:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ class HKDevice:
|
|||||||
# The platorms we have forwarded the config entry so far. If a new
|
# The platorms we have forwarded the config entry so far. If a new
|
||||||
# accessory is added to a bridge we may have to load additional
|
# accessory is added to a bridge we may have to load additional
|
||||||
# platforms. We don't want to load all platforms up front if its just
|
# platforms. We don't want to load all platforms up front if its just
|
||||||
# a lightbulb. And we dont want to forward a config entry twice
|
# a lightbulb. And we don't want to forward a config entry twice
|
||||||
# (triggers a Config entry already set up error)
|
# (triggers a Config entry already set up error)
|
||||||
self.platforms = set()
|
self.platforms = set()
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ class HKDevice:
|
|||||||
key = (row["aid"], row["iid"])
|
key = (row["aid"], row["iid"])
|
||||||
|
|
||||||
# If the key was returned by put_characteristics() then the
|
# If the key was returned by put_characteristics() then the
|
||||||
# change didnt work
|
# change didn't work
|
||||||
if key in results:
|
if key in results:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ class HomematicipPowerSensor(HomematicipGenericDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self) -> float:
|
def state(self) -> float:
|
||||||
"""Representation of the HomematicIP power comsumption value."""
|
"""Representation of the HomematicIP power consumption value."""
|
||||||
return self._device.currentPowerConsumption
|
return self._device.currentPowerConsumption
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -356,7 +356,7 @@ class HomematicipTodayRainSensor(HomematicipGenericDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self) -> float:
|
def state(self) -> float:
|
||||||
"""Representation of the HomematicIP todays rain value."""
|
"""Representation of the HomematicIP today's rain value."""
|
||||||
return round(self._device.todayRainCounter, 2)
|
return round(self._device.todayRainCounter, 2)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -139,7 +139,7 @@ def async_register_services(hass, config, insteon_modem):
|
|||||||
def print_aldb(service):
|
def print_aldb(service):
|
||||||
"""Print the All-Link Database for a device."""
|
"""Print the All-Link Database for a device."""
|
||||||
# For now this sends logs to the log file.
|
# For now this sends logs to the log file.
|
||||||
# Furture direction is to create an INSTEON control panel.
|
# Future direction is to create an INSTEON control panel.
|
||||||
entity_id = service.data[CONF_ENTITY_ID]
|
entity_id = service.data[CONF_ENTITY_ID]
|
||||||
signal = f"{entity_id}_{SIGNAL_PRINT_ALDB}"
|
signal = f"{entity_id}_{SIGNAL_PRINT_ALDB}"
|
||||||
dispatcher_send(hass, signal)
|
dispatcher_send(hass, signal)
|
||||||
@ -147,7 +147,7 @@ def async_register_services(hass, config, insteon_modem):
|
|||||||
def print_im_aldb(service):
|
def print_im_aldb(service):
|
||||||
"""Print the All-Link Database for a device."""
|
"""Print the All-Link Database for a device."""
|
||||||
# For now this sends logs to the log file.
|
# For now this sends logs to the log file.
|
||||||
# Furture direction is to create an INSTEON control panel.
|
# Future direction is to create an INSTEON control panel.
|
||||||
print_aldb_to_log(insteon_modem.aldb)
|
print_aldb_to_log(insteon_modem.aldb)
|
||||||
|
|
||||||
def x10_all_units_off(service):
|
def x10_all_units_off(service):
|
||||||
|
@ -279,7 +279,7 @@ class iOSIdentifyDeviceView(HomeAssistantView):
|
|||||||
name = "api:ios:identify"
|
name = "api:ios:identify"
|
||||||
|
|
||||||
def __init__(self, config_path):
|
def __init__(self, config_path):
|
||||||
"""Initiliaze the view."""
|
"""Initialize the view."""
|
||||||
self._config_path = config_path
|
self._config_path = config_path
|
||||||
|
|
||||||
async def post(self, request):
|
async def post(self, request):
|
||||||
|
@ -44,11 +44,11 @@ class DiscoveryService(pizone.Listener):
|
|||||||
async_dispatcher_send(self.hass, DISPATCH_CONTROLLER_RECONNECTED, ctrl)
|
async_dispatcher_send(self.hass, DISPATCH_CONTROLLER_RECONNECTED, ctrl)
|
||||||
|
|
||||||
def controller_update(self, ctrl: pizone.Controller) -> None:
|
def controller_update(self, ctrl: pizone.Controller) -> None:
|
||||||
"""System update message is recieved from the controller."""
|
"""System update message is received from the controller."""
|
||||||
async_dispatcher_send(self.hass, DISPATCH_CONTROLLER_UPDATE, ctrl)
|
async_dispatcher_send(self.hass, DISPATCH_CONTROLLER_UPDATE, ctrl)
|
||||||
|
|
||||||
def zone_update(self, ctrl: pizone.Controller, zone: pizone.Zone) -> None:
|
def zone_update(self, ctrl: pizone.Controller, zone: pizone.Zone) -> None:
|
||||||
"""Zone update message is recieved from the controller."""
|
"""Zone update message is received from the controller."""
|
||||||
async_dispatcher_send(self.hass, DISPATCH_ZONE_UPDATE, ctrl, zone)
|
async_dispatcher_send(self.hass, DISPATCH_ZONE_UPDATE, ctrl, zone)
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ class VarAbs(LcnServiceCall):
|
|||||||
"""Set absolute value of a variable or setpoint.
|
"""Set absolute value of a variable or setpoint.
|
||||||
|
|
||||||
Variable has to be set as counter!
|
Variable has to be set as counter!
|
||||||
Reguator setpoints can also be set using R1VARSETPOINT, R2VARSETPOINT.
|
Regulator setpoints can also be set using R1VARSETPOINT, R2VARSETPOINT.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
schema = LcnServiceCall.schema.extend(
|
schema = LcnServiceCall.schema.extend(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Support for settting the level of logging for components."""
|
"""Support for setting the level of logging for components."""
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -737,7 +737,7 @@ class MediaPlayerDevice(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def capability_attributes(self):
|
def capability_attributes(self):
|
||||||
"""Return capabilitiy attributes."""
|
"""Return capability attributes."""
|
||||||
supported_features = self.supported_features or 0
|
supported_features = self.supported_features or 0
|
||||||
data = {}
|
data = {}
|
||||||
|
|
||||||
|
@ -12,15 +12,15 @@ from .const import CONF_TRACK_HOME, DOMAIN, HOME_LOCATION_NAME
|
|||||||
@callback
|
@callback
|
||||||
def configured_instances(hass):
|
def configured_instances(hass):
|
||||||
"""Return a set of configured SimpliSafe instances."""
|
"""Return a set of configured SimpliSafe instances."""
|
||||||
entites = []
|
entries = []
|
||||||
for entry in hass.config_entries.async_entries(DOMAIN):
|
for entry in hass.config_entries.async_entries(DOMAIN):
|
||||||
if entry.data.get("track_home"):
|
if entry.data.get("track_home"):
|
||||||
entites.append("home")
|
entries.append("home")
|
||||||
continue
|
continue
|
||||||
entites.append(
|
entries.append(
|
||||||
f"{entry.data.get(CONF_LATITUDE)}-{entry.data.get(CONF_LONGITUDE)}"
|
f"{entry.data.get(CONF_LATITUDE)}-{entry.data.get(CONF_LONGITUDE)}"
|
||||||
)
|
)
|
||||||
return set(entites)
|
return set(entries)
|
||||||
|
|
||||||
|
|
||||||
class MetFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
class MetFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
@ -113,7 +113,7 @@ class MfiSwitch(SwitchDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes fof the device."""
|
"""Return the state attributes for the device."""
|
||||||
attr = {}
|
attr = {}
|
||||||
attr["volts"] = round(self._port.data.get("v_rms", 0), 1)
|
attr["volts"] = round(self._port.data.get("v_rms", 0), 1)
|
||||||
attr["amps"] = round(self._port.data.get("i_rms", 0), 1)
|
attr["amps"] = round(self._port.data.get("i_rms", 0), 1)
|
||||||
|
@ -299,7 +299,7 @@ class MikrotikHub:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def firmware(self):
|
def firmware(self):
|
||||||
"""Return the firware of the hub."""
|
"""Return the firmware of the hub."""
|
||||||
return self._mk_data.firmware
|
return self._mk_data.firmware
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -91,7 +91,7 @@ async def async_setup(hass, config):
|
|||||||
"""Set up the pi_hole integration."""
|
"""Set up the pi_hole integration."""
|
||||||
|
|
||||||
def get_data():
|
def get_data():
|
||||||
"""Retrive component data."""
|
"""Retrieve component data."""
|
||||||
return hass.data[DOMAIN]
|
return hass.data[DOMAIN]
|
||||||
|
|
||||||
def ensure_api_token(call_data):
|
def ensure_api_token(call_data):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Constants for the pi_hole intergration."""
|
"""Constants for the pi_hole integration."""
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
DOMAIN = "pi_hole"
|
DOMAIN = "pi_hole"
|
||||||
|
@ -334,7 +334,7 @@ class PrometheusMetrics:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _sensor_fallback_metric(state, unit):
|
def _sensor_fallback_metric(state, unit):
|
||||||
"""Get metric from fallback logic for compatability."""
|
"""Get metric from fallback logic for compatibility."""
|
||||||
if unit in (None, ""):
|
if unit in (None, ""):
|
||||||
_LOGGER.debug("Unsupported sensor: %s", state.entity_id)
|
_LOGGER.debug("Unsupported sensor: %s", state.entity_id)
|
||||||
return None
|
return None
|
||||||
|
@ -233,7 +233,7 @@ class RMVDepartureData:
|
|||||||
)
|
)
|
||||||
except RMVtransportApiConnectionError:
|
except RMVtransportApiConnectionError:
|
||||||
self.departures = []
|
self.departures = []
|
||||||
_LOGGER.warning("Could not retrive data from rmv.de")
|
_LOGGER.warning("Could not retrieve data from rmv.de")
|
||||||
return
|
return
|
||||||
self.station = _data.get("station")
|
self.station = _data.get("station")
|
||||||
_deps = []
|
_deps = []
|
||||||
|
@ -217,7 +217,7 @@ class SAJsensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def per_total_basis(self) -> bool:
|
def per_total_basis(self) -> bool:
|
||||||
"""Return if the sensors value is cummulative or not."""
|
"""Return if the sensors value is cumulative or not."""
|
||||||
return self._sensor.per_total_basis
|
return self._sensor.per_total_basis
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -100,7 +100,7 @@ class SigfoxAPI:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def auth(self):
|
def auth(self):
|
||||||
"""Return the API authentification."""
|
"""Return the API authentication."""
|
||||||
return self._auth
|
return self._auth
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -199,7 +199,7 @@ class Smappee:
|
|||||||
try:
|
try:
|
||||||
return self._smappy.get_consumption(location_id, start, end, aggregation)
|
return self._smappy.get_consumption(location_id, start, end, aggregation)
|
||||||
except RequestException as error:
|
except RequestException as error:
|
||||||
_LOGGER.error("Error getting comsumption from Smappee cloud. (%s)", error)
|
_LOGGER.error("Error getting consumption from Smappee cloud. (%s)", error)
|
||||||
|
|
||||||
def get_sensor_consumption(self, location_id, sensor_id, aggregation, delta):
|
def get_sensor_consumption(self, location_id, sensor_id, aggregation, delta):
|
||||||
"""Update data from Smappee."""
|
"""Update data from Smappee."""
|
||||||
@ -221,7 +221,7 @@ class Smappee:
|
|||||||
location_id, sensor_id, start, end, aggregation
|
location_id, sensor_id, start, end, aggregation
|
||||||
)
|
)
|
||||||
except RequestException as error:
|
except RequestException as error:
|
||||||
_LOGGER.error("Error getting comsumption from Smappee cloud. (%s)", error)
|
_LOGGER.error("Error getting consumption from Smappee cloud. (%s)", error)
|
||||||
|
|
||||||
def actuator_on(self, location_id, actuator_id, is_remote_switch, duration=None):
|
def actuator_on(self, location_id, actuator_id, is_remote_switch, duration=None):
|
||||||
"""Turn on actuator."""
|
"""Turn on actuator."""
|
||||||
|
@ -54,7 +54,7 @@ class SolarEdgeConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None):
|
async def async_step_user(self, user_input=None):
|
||||||
"""Step when user intializes a integration."""
|
"""Step when user initializes a integration."""
|
||||||
self._errors = {}
|
self._errors = {}
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
name = slugify(user_input.get(CONF_NAME, DEFAULT_NAME))
|
name = slugify(user_input.get(CONF_NAME, DEFAULT_NAME))
|
||||||
|
@ -54,7 +54,7 @@ class SolarLogConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None):
|
async def async_step_user(self, user_input=None):
|
||||||
"""Step when user intializes a integration."""
|
"""Step when user initializes a integration."""
|
||||||
self._errors = {}
|
self._errors = {}
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
# set some defaults in case we need to return to the form
|
# set some defaults in case we need to return to the form
|
||||||
|
@ -95,7 +95,7 @@ def stream_worker(hass, stream, quit_event):
|
|||||||
if packet.is_keyframe:
|
if packet.is_keyframe:
|
||||||
# Calculate the segment duration by multiplying the presentation
|
# Calculate the segment duration by multiplying the presentation
|
||||||
# timestamp by the time base, which gets us total seconds.
|
# timestamp by the time base, which gets us total seconds.
|
||||||
# By then dividing by the seqence, we can calculate how long
|
# By then dividing by the sequence, we can calculate how long
|
||||||
# each segment is, assuming the stream starts from 0.
|
# each segment is, assuming the stream starts from 0.
|
||||||
segment_duration = (packet.pts * packet.time_base) / sequence
|
segment_duration = (packet.pts * packet.time_base) / sequence
|
||||||
# Save segment to outputs
|
# Save segment to outputs
|
||||||
|
@ -126,14 +126,14 @@ class TodSensor(BinarySensorDevice):
|
|||||||
current_local_date = self.current_datetime.astimezone(
|
current_local_date = self.current_datetime.astimezone(
|
||||||
self.hass.config.time_zone
|
self.hass.config.time_zone
|
||||||
).date()
|
).date()
|
||||||
# calcuate utc datetime corecponding to local time
|
# calculate utc datetime corecponding to local time
|
||||||
utc_datetime = self.hass.config.time_zone.localize(
|
utc_datetime = self.hass.config.time_zone.localize(
|
||||||
datetime.combine(current_local_date, naive_time)
|
datetime.combine(current_local_date, naive_time)
|
||||||
).astimezone(tz=pytz.UTC)
|
).astimezone(tz=pytz.UTC)
|
||||||
return utc_datetime
|
return utc_datetime
|
||||||
|
|
||||||
def _calculate_initial_boudary_time(self):
|
def _calculate_initial_boudary_time(self):
|
||||||
"""Calculate internal absolute time boudaries."""
|
"""Calculate internal absolute time boundaries."""
|
||||||
nowutc = self.current_datetime
|
nowutc = self.current_datetime
|
||||||
# If after value is a sun event instead of absolute time
|
# If after value is a sun event instead of absolute time
|
||||||
if is_sun_event(self._after):
|
if is_sun_event(self._after):
|
||||||
|
@ -137,7 +137,7 @@ class ToonData:
|
|||||||
|
|
||||||
def update(self, now=None):
|
def update(self, now=None):
|
||||||
"""Update all Toon data and notify entities."""
|
"""Update all Toon data and notify entities."""
|
||||||
# Ignore the TTL meganism from client library
|
# Ignore the TTL mechanism from client library
|
||||||
# It causes a lots of issues, hence we take control over caching
|
# It causes a lots of issues, hence we take control over caching
|
||||||
self._toon._clear_cache() # pylint: disable=protected-access
|
self._toon._clear_cache() # pylint: disable=protected-access
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ class TradfriLight(TradfriBaseDevice, Light):
|
|||||||
color_command = self._device_control.set_hsb(**color_data)
|
color_command = self._device_control.set_hsb(**color_data)
|
||||||
transition_time = None
|
transition_time = None
|
||||||
|
|
||||||
# HSB can always be set, but color temp + brightness is bulb dependant
|
# HSB can always be set, but color temp + brightness is bulb dependent
|
||||||
command = dimmer_command
|
command = dimmer_command
|
||||||
if command is not None:
|
if command is not None:
|
||||||
command += color_command
|
command += color_command
|
||||||
|
@ -80,7 +80,7 @@ class TransmissionSwitch(ToggleEntity):
|
|||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
"""Turn the device off."""
|
"""Turn the device off."""
|
||||||
if self.type == "on_off":
|
if self.type == "on_off":
|
||||||
_LOGGING.debug("Stoping all torrents")
|
_LOGGING.debug("Stopping all torrents")
|
||||||
self._tm_client.api.stop_torrents()
|
self._tm_client.api.stop_torrents()
|
||||||
if self.type == "turtle_mode":
|
if self.type == "turtle_mode":
|
||||||
_LOGGING.debug("Turning Turtle Mode of Transmission off")
|
_LOGGING.debug("Turning Turtle Mode of Transmission off")
|
||||||
|
@ -140,7 +140,7 @@ class UtilityMeterSensor(RestoreEntity):
|
|||||||
diff = Decimal(new_state.state) - Decimal(old_state.state)
|
diff = Decimal(new_state.state) - Decimal(old_state.state)
|
||||||
|
|
||||||
if (not self._sensor_net_consumption) and diff < 0:
|
if (not self._sensor_net_consumption) and diff < 0:
|
||||||
# Source sensor just rolled over for unknow reasons,
|
# Source sensor just rolled over for unknown reasons,
|
||||||
return
|
return
|
||||||
self._state += diff
|
self._state += diff
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ class VacuumDevice(_BaseVacuum, ToggleEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def capability_attributes(self):
|
def capability_attributes(self):
|
||||||
"""Return capabilitiy attributes."""
|
"""Return capability attributes."""
|
||||||
if self.fan_speed is not None:
|
if self.fan_speed is not None:
|
||||||
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ class StateVacuumDevice(_BaseVacuum):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def capability_attributes(self):
|
def capability_attributes(self):
|
||||||
"""Return capabilitiy attributes."""
|
"""Return capability attributes."""
|
||||||
if self.fan_speed is not None:
|
if self.fan_speed is not None:
|
||||||
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
return {ATTR_FAN_SPEED_LIST: self.fan_speed_list}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class VelbusConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None):
|
async def async_step_user(self, user_input=None):
|
||||||
"""Step when user intializes a integration."""
|
"""Step when user initializes a integration."""
|
||||||
self._errors = {}
|
self._errors = {}
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
name = slugify(user_input[CONF_NAME])
|
name = slugify(user_input[CONF_NAME])
|
||||||
|
@ -145,7 +145,7 @@ class WaterHeaterDevice(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def capability_attributes(self):
|
def capability_attributes(self):
|
||||||
"""Return capabilitiy attributes."""
|
"""Return capability attributes."""
|
||||||
supported_features = self.supported_features or 0
|
supported_features = self.supported_features or 0
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
@ -131,7 +131,7 @@ set_nimbus_dial_configuration:
|
|||||||
description: The minimum value allowed to be set
|
description: The minimum value allowed to be set
|
||||||
example: 0
|
example: 0
|
||||||
max_value:
|
max_value:
|
||||||
description: The maximum value allowd to be set
|
description: The maximum value allowed to be set
|
||||||
example: 500
|
example: 500
|
||||||
min_position:
|
min_position:
|
||||||
description: The minimum position the dial hand can rotate to generally [0-360]
|
description: The minimum position the dial hand can rotate to generally [0-360]
|
||||||
@ -141,10 +141,10 @@ set_nimbus_dial_configuration:
|
|||||||
example: 360
|
example: 360
|
||||||
|
|
||||||
set_nimbus_dial_state:
|
set_nimbus_dial_state:
|
||||||
description: Set the value and lables of an individual nimbus dial
|
description: Set the value and labels of an individual nimbus dial
|
||||||
fields:
|
fields:
|
||||||
entity_id:
|
entity_id:
|
||||||
description: Name fo the entity to set.
|
description: Name of the entity to set.
|
||||||
example: 'wink.nimbus_dial_3'
|
example: 'wink.nimbus_dial_3'
|
||||||
value:
|
value:
|
||||||
description: The value that should be set (Should be between min_value and max_value)
|
description: The value that should be set (Should be between min_value and max_value)
|
||||||
|
@ -2,7 +2,7 @@ enable_output:
|
|||||||
description: Enable or disable an output port
|
description: Enable or disable an output port
|
||||||
fields:
|
fields:
|
||||||
entity_id:
|
entity_id:
|
||||||
description: Name(s) of entites to enable/disable port on.
|
description: Name(s) of entities to enable/disable port on.
|
||||||
example: 'media_player.yamaha'
|
example: 'media_player.yamaha'
|
||||||
port:
|
port:
|
||||||
description: Name of port to enable/disable.
|
description: Name of port to enable/disable.
|
||||||
|
@ -424,7 +424,7 @@ class ZHAGateway:
|
|||||||
# ZHA already has an initialized device so either the device was assigned a
|
# ZHA already has an initialized device so either the device was assigned a
|
||||||
# new nwk or device was physically reset and added again without being removed
|
# new nwk or device was physically reset and added again without being removed
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"device - %s has been reset and readded or its nwk address changed",
|
"device - %s has been reset and re-added or its nwk address changed",
|
||||||
f"0x{device.nwk:04x}:{device.ieee}",
|
f"0x{device.nwk:04x}:{device.ieee}",
|
||||||
)
|
)
|
||||||
await self._async_device_rejoined(zha_device)
|
await self._async_device_rejoined(zha_device)
|
||||||
|
@ -88,7 +88,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
hub_is_initialized = False
|
hub_is_initialized = False
|
||||||
|
|
||||||
async def startup():
|
async def startup():
|
||||||
"""Start hub socket after all climate entity is setted up."""
|
"""Start hub socket after all climate entity is set up."""
|
||||||
nonlocal hub_is_initialized
|
nonlocal hub_is_initialized
|
||||||
if not all([device.is_initialized for device in devices]):
|
if not all([device.is_initialized for device in devices]):
|
||||||
return
|
return
|
||||||
|
@ -529,7 +529,7 @@ class ZWaveClimateBase(ZWaveDeviceEntity, ClimateDevice):
|
|||||||
self._mode().data = operation_mode
|
self._mode().data = operation_mode
|
||||||
|
|
||||||
def turn_aux_heat_on(self):
|
def turn_aux_heat_on(self):
|
||||||
"""Turn auxillary heater on."""
|
"""Turn auxiliary heater on."""
|
||||||
if not self._aux_heat:
|
if not self._aux_heat:
|
||||||
return
|
return
|
||||||
operation_mode = AUX_HEAT_ZWAVE_MODE
|
operation_mode = AUX_HEAT_ZWAVE_MODE
|
||||||
@ -537,7 +537,7 @@ class ZWaveClimateBase(ZWaveDeviceEntity, ClimateDevice):
|
|||||||
self._mode().data = operation_mode
|
self._mode().data = operation_mode
|
||||||
|
|
||||||
def turn_aux_heat_off(self):
|
def turn_aux_heat_off(self):
|
||||||
"""Turn auxillary heater off."""
|
"""Turn auxiliary heater off."""
|
||||||
if not self._aux_heat:
|
if not self._aux_heat:
|
||||||
return
|
return
|
||||||
if HVAC_MODE_HEAT in self._hvac_mapping:
|
if HVAC_MODE_HEAT in self._hvac_mapping:
|
||||||
|
@ -180,7 +180,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
if len(str(usercode)) < 4:
|
if len(str(usercode)) < 4:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Invalid code provided: (%s) "
|
"Invalid code provided: (%s) "
|
||||||
"usercode must be atleast 4 and at most"
|
"usercode must be at least 4 and at most"
|
||||||
" %s digits",
|
" %s digits",
|
||||||
usercode,
|
usercode,
|
||||||
len(value.data),
|
len(value.data),
|
||||||
|
@ -947,7 +947,7 @@ class SystemOptions:
|
|||||||
self.disable_new_entities = disable_new_entities
|
self.disable_new_entities = disable_new_entities
|
||||||
|
|
||||||
def as_dict(self) -> Dict[str, Any]:
|
def as_dict(self) -> Dict[str, Any]:
|
||||||
"""Return dictionary version of this config entrys system options."""
|
"""Return dictionary version of this config entries system options."""
|
||||||
return {"disable_new_entities": self.disable_new_entities}
|
return {"disable_new_entities": self.disable_new_entities}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class UnknownHandler(FlowError):
|
|||||||
|
|
||||||
|
|
||||||
class UnknownFlow(FlowError):
|
class UnknownFlow(FlowError):
|
||||||
"""Uknown flow specified."""
|
"""Unknown flow specified."""
|
||||||
|
|
||||||
|
|
||||||
class UnknownStep(FlowError):
|
class UnknownStep(FlowError):
|
||||||
|
@ -42,7 +42,7 @@ class KeywordStyleAdapter(logging.LoggerAdapter):
|
|||||||
def process(
|
def process(
|
||||||
self, msg: Any, kwargs: MutableMapping[str, Any]
|
self, msg: Any, kwargs: MutableMapping[str, Any]
|
||||||
) -> Tuple[Any, MutableMapping[str, Any]]:
|
) -> Tuple[Any, MutableMapping[str, Any]]:
|
||||||
"""Process the keyward args in preparation for logging."""
|
"""Process the keyword args in preparation for logging."""
|
||||||
return (
|
return (
|
||||||
msg,
|
msg,
|
||||||
{
|
{
|
||||||
|
@ -469,7 +469,7 @@ def _wrap_state(hass, state):
|
|||||||
def _get_state(hass, entity_id):
|
def _get_state(hass, entity_id):
|
||||||
state = hass.states.get(entity_id)
|
state = hass.states.get(entity_id)
|
||||||
if state is None:
|
if state is None:
|
||||||
# Only need to collect if none, if not none collect first actuall
|
# Only need to collect if none, if not none collect first actual
|
||||||
# access to the state properties in the state wrapper.
|
# access to the state properties in the state wrapper.
|
||||||
_collect_state(hass, entity_id)
|
_collect_state(hass, entity_id)
|
||||||
return None
|
return None
|
||||||
|
@ -15,7 +15,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def is_virtual_env() -> bool:
|
def is_virtual_env() -> bool:
|
||||||
"""Return if we run in a virtual environtment."""
|
"""Return if we run in a virtual environment."""
|
||||||
# Check supports venv && virtualenv
|
# Check supports venv && virtualenv
|
||||||
return getattr(sys, "base_prefix", sys.prefix) != sys.prefix or hasattr(
|
return getattr(sys, "base_prefix", sys.prefix) != sys.prefix or hasattr(
|
||||||
sys, "real_prefix"
|
sys, "real_prefix"
|
||||||
|
@ -56,7 +56,7 @@ def gather_info(arguments) -> Info:
|
|||||||
|
|
||||||
YES_NO = {
|
YES_NO = {
|
||||||
"validators": [["Type either 'yes' or 'no'", lambda value: value in ("yes", "no")]],
|
"validators": [["Type either 'yes' or 'no'", lambda value: value in ("yes", "no")]],
|
||||||
"convertor": lambda value: value == "yes",
|
"converter": lambda value: value == "yes",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -155,8 +155,8 @@ def _gather_info(fields) -> dict:
|
|||||||
break
|
break
|
||||||
|
|
||||||
if hint is None:
|
if hint is None:
|
||||||
if "convertor" in info:
|
if "converter" in info:
|
||||||
value = info["convertor"](value)
|
value = info["converter"](value)
|
||||||
answers[key] = value
|
answers[key] = value
|
||||||
|
|
||||||
return answers
|
return answers
|
||||||
|
@ -321,7 +321,7 @@ async def test_include_exclude_config(hass):
|
|||||||
|
|
||||||
|
|
||||||
async def test_setup_user_no_notify_service(hass):
|
async def test_setup_user_no_notify_service(hass):
|
||||||
"""Test setup flow abort if there is no avilable notify service."""
|
"""Test setup flow abort if there is no available notify service."""
|
||||||
async_mock_service(hass, "notify", "test1", NOTIFY_SERVICE_SCHEMA)
|
async_mock_service(hass, "notify", "test1", NOTIFY_SERVICE_SCHEMA)
|
||||||
notify_auth_module = await auth_mfa_module_from_config(
|
notify_auth_module = await auth_mfa_module_from_config(
|
||||||
hass, {"type": "notify", "exclude": "test1"}
|
hass, {"type": "notify", "exclude": "test1"}
|
||||||
|
@ -453,7 +453,7 @@ async def test_refresh_token_type_long_lived_access_token(hass):
|
|||||||
|
|
||||||
|
|
||||||
async def test_cannot_deactive_owner(mock_hass):
|
async def test_cannot_deactive_owner(mock_hass):
|
||||||
"""Test that we cannot deactive the owner."""
|
"""Test that we cannot deactivate the owner."""
|
||||||
manager = await auth.auth_manager_from_config(mock_hass, [], [])
|
manager = await auth.auth_manager_from_config(mock_hass, [], [])
|
||||||
owner = MockUser(is_owner=True).add_to_auth_manager(manager)
|
owner = MockUser(is_owner=True).add_to_auth_manager(manager)
|
||||||
|
|
||||||
|
@ -541,7 +541,7 @@ async def test_rendering_template_legacy_user(
|
|||||||
|
|
||||||
|
|
||||||
async def test_api_call_service_not_found(hass, mock_api_client):
|
async def test_api_call_service_not_found(hass, mock_api_client):
|
||||||
"""Test if the API failes 400 if unknown service."""
|
"""Test if the API fails 400 if unknown service."""
|
||||||
resp = await mock_api_client.post(
|
resp = await mock_api_client.post(
|
||||||
const.URL_API_SERVICES_SERVICE.format("test_domain", "test_service")
|
const.URL_API_SERVICES_SERVICE.format("test_domain", "test_service")
|
||||||
)
|
)
|
||||||
@ -549,7 +549,7 @@ async def test_api_call_service_not_found(hass, mock_api_client):
|
|||||||
|
|
||||||
|
|
||||||
async def test_api_call_service_bad_data(hass, mock_api_client):
|
async def test_api_call_service_bad_data(hass, mock_api_client):
|
||||||
"""Test if the API failes 400 if unknown service."""
|
"""Test if the API fails 400 if unknown service."""
|
||||||
test_value = []
|
test_value = []
|
||||||
|
|
||||||
@ha.callback
|
@ha.callback
|
||||||
|
@ -95,7 +95,7 @@ async def test_apprise_notification(hass):
|
|||||||
assert await async_setup_component(hass, BASE_COMPONENT, config)
|
assert await async_setup_component(hass, BASE_COMPONENT, config)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Test the existance of our service
|
# Test the existence of our service
|
||||||
assert hass.services.has_service(BASE_COMPONENT, "test")
|
assert hass.services.has_service(BASE_COMPONENT, "test")
|
||||||
|
|
||||||
# Test the call to our underlining notify() call
|
# Test the call to our underlining notify() call
|
||||||
@ -134,7 +134,7 @@ async def test_apprise_notification_with_target(hass, tmp_path):
|
|||||||
assert await async_setup_component(hass, BASE_COMPONENT, config)
|
assert await async_setup_component(hass, BASE_COMPONENT, config)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Test the existance of our service
|
# Test the existence of our service
|
||||||
assert hass.services.has_service(BASE_COMPONENT, "test")
|
assert hass.services.has_service(BASE_COMPONENT, "test")
|
||||||
|
|
||||||
# Test the call to our underlining notify() call
|
# Test the call to our underlining notify() call
|
||||||
|
@ -123,7 +123,7 @@ async def test_turn_off(player, state):
|
|||||||
|
|
||||||
@pytest.mark.parametrize("mute", [True, False])
|
@pytest.mark.parametrize("mute", [True, False])
|
||||||
async def test_mute_volume(player, state, mute):
|
async def test_mute_volume(player, state, mute):
|
||||||
"""Test mute functionallity."""
|
"""Test mute functionality."""
|
||||||
await player.async_mute_volume(mute)
|
await player.async_mute_volume(mute)
|
||||||
state.set_mute.assert_called_with(mute)
|
state.set_mute.assert_called_with(mute)
|
||||||
player.async_schedule_update_ha_state.assert_called_with()
|
player.async_schedule_update_ha_state.assert_called_with()
|
||||||
@ -200,14 +200,14 @@ async def test_select_sound_mode(player, state, mode, mode_sel, mode_2ch, mode_m
|
|||||||
|
|
||||||
|
|
||||||
async def test_volume_up(player, state):
|
async def test_volume_up(player, state):
|
||||||
"""Test mute functionallity."""
|
"""Test mute functionality."""
|
||||||
await player.async_volume_up()
|
await player.async_volume_up()
|
||||||
state.inc_volume.assert_called_with()
|
state.inc_volume.assert_called_with()
|
||||||
player.async_schedule_update_ha_state.assert_called_with()
|
player.async_schedule_update_ha_state.assert_called_with()
|
||||||
|
|
||||||
|
|
||||||
async def test_volume_down(player, state):
|
async def test_volume_down(player, state):
|
||||||
"""Test mute functionallity."""
|
"""Test mute functionality."""
|
||||||
await player.async_volume_down()
|
await player.async_volume_down()
|
||||||
state.dec_volume.assert_called_with()
|
state.dec_volume.assert_called_with()
|
||||||
player.async_schedule_update_ha_state.assert_called_with()
|
player.async_schedule_update_ha_state.assert_called_with()
|
||||||
|
@ -149,7 +149,7 @@ class TestBayesianBinarySensor(unittest.TestCase):
|
|||||||
assert state.state == "off"
|
assert state.state == "off"
|
||||||
|
|
||||||
def test_threshold(self):
|
def test_threshold(self):
|
||||||
"""Test sensor on probabilty threshold limits."""
|
"""Test sensor on probability threshold limits."""
|
||||||
config = {
|
config = {
|
||||||
"binary_sensor": {
|
"binary_sensor": {
|
||||||
"name": "Test_Binary",
|
"name": "Test_Binary",
|
||||||
|
@ -19,7 +19,7 @@ HOST = "example.com"
|
|||||||
|
|
||||||
@pytest.fixture(name="test_connect")
|
@pytest.fixture(name="test_connect")
|
||||||
def mock_controller():
|
def mock_controller():
|
||||||
"""Mock a successfull _prt_in_configuration_exists."""
|
"""Mock a successful _prt_in_configuration_exists."""
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.cert_expiry.config_flow.CertexpiryConfigFlow._test_connection",
|
"homeassistant.components.cert_expiry.config_flow.CertexpiryConfigFlow._test_connection",
|
||||||
side_effect=lambda *_: mock_coro(True),
|
side_effect=lambda *_: mock_coro(True),
|
||||||
|
@ -217,7 +217,7 @@ async def test_google_config_should_2fa(hass, mock_cloud_setup, mock_cloud_login
|
|||||||
|
|
||||||
|
|
||||||
async def test_set_username(hass):
|
async def test_set_username(hass):
|
||||||
"""Test we set username during loggin."""
|
"""Test we set username during login."""
|
||||||
prefs = MagicMock(
|
prefs = MagicMock(
|
||||||
alexa_enabled=False,
|
alexa_enabled=False,
|
||||||
google_enabled=False,
|
google_enabled=False,
|
||||||
|
@ -480,7 +480,7 @@ async def test_set_protection_value_failed(hass, client):
|
|||||||
|
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
"/api/zwave/protection/18",
|
"/api/zwave/protection/18",
|
||||||
data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}),
|
data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}),
|
||||||
)
|
)
|
||||||
|
|
||||||
assert resp.status == 202
|
assert resp.status == 202
|
||||||
@ -512,7 +512,7 @@ async def test_set_protection_value_nonexisting_node(hass, client):
|
|||||||
|
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
"/api/zwave/protection/18",
|
"/api/zwave/protection/18",
|
||||||
data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}),
|
data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}),
|
||||||
)
|
)
|
||||||
|
|
||||||
assert resp.status == 404
|
assert resp.status == 404
|
||||||
@ -532,7 +532,7 @@ async def test_set_protection_value_missing_class(hass, client):
|
|||||||
|
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
"/api/zwave/protection/17",
|
"/api/zwave/protection/17",
|
||||||
data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}),
|
data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}),
|
||||||
)
|
)
|
||||||
|
|
||||||
assert resp.status == 404
|
assert resp.status == 404
|
||||||
|
@ -30,7 +30,7 @@ INVALID_CONFIG_MINIMAL = {
|
|||||||
"api_key": "foo",
|
"api_key": "foo",
|
||||||
"forecast": [1, 2],
|
"forecast": [1, 2],
|
||||||
"hourly_forecast": [1, 2],
|
"hourly_forecast": [1, 2],
|
||||||
"monitored_conditions": ["sumary", "iocn", "temperature_high"],
|
"monitored_conditions": ["summary", "iocn", "temperature_high"],
|
||||||
"scan_interval": timedelta(seconds=120),
|
"scan_interval": timedelta(seconds=120),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -610,7 +610,7 @@ async def test_close_cover(hass_hue, hue_client):
|
|||||||
|
|
||||||
|
|
||||||
async def test_set_position_cover(hass_hue, hue_client):
|
async def test_set_position_cover(hass_hue, hue_client):
|
||||||
"""Test setting postion cover ."""
|
"""Test setting position cover ."""
|
||||||
COVER_ID = "cover.living_room_window"
|
COVER_ID = "cover.living_room_window"
|
||||||
# Turn the office light off first
|
# Turn the office light off first
|
||||||
await hass_hue.services.async_call(
|
await hass_hue.services.async_call(
|
||||||
|
@ -88,7 +88,7 @@ class TestFacebook(unittest.TestCase):
|
|||||||
"""Test sending a message without a target."""
|
"""Test sending a message without a target."""
|
||||||
mock.register_uri(requests_mock.POST, facebook.BASE_URL, status_code=200)
|
mock.register_uri(requests_mock.POST, facebook.BASE_URL, status_code=200)
|
||||||
|
|
||||||
self.facebook.send_message(message="goin nowhere")
|
self.facebook.send_message(message="going nowhere")
|
||||||
assert not mock.called
|
assert not mock.called
|
||||||
|
|
||||||
@requests_mock.Mocker()
|
@requests_mock.Mocker()
|
||||||
|
@ -91,7 +91,7 @@ class TestFritzboxClimate(unittest.TestCase):
|
|||||||
|
|
||||||
@patch.object(FritzboxThermostat, "set_hvac_mode")
|
@patch.object(FritzboxThermostat, "set_hvac_mode")
|
||||||
def test_set_temperature_operation_mode_precedence(self, mock_set_op):
|
def test_set_temperature_operation_mode_precedence(self, mock_set_op):
|
||||||
"""Test set_temperature for precedence of operation_mode arguement."""
|
"""Test set_temperature for precedence of operation_mode argument."""
|
||||||
self.thermostat.set_temperature(hvac_mode="heat", temperature=23.0)
|
self.thermostat.set_temperature(hvac_mode="heat", temperature=23.0)
|
||||||
mock_set_op.assert_called_once_with("heat")
|
mock_set_op.assert_called_once_with("heat")
|
||||||
self.thermostat._device.set_target_temperature.assert_not_called()
|
self.thermostat._device.set_target_temperature.assert_not_called()
|
||||||
|
@ -506,7 +506,7 @@ async def test_select_radio_favorite(hass, config_entry, config, controller, fav
|
|||||||
async def test_select_radio_favorite_command_error(
|
async def test_select_radio_favorite_command_error(
|
||||||
hass, config_entry, config, controller, favorites, caplog
|
hass, config_entry, config, controller, favorites, caplog
|
||||||
):
|
):
|
||||||
"""Tests command error loged when playing favorite."""
|
"""Tests command error logged when playing favorite."""
|
||||||
await setup_platform(hass, config_entry, config)
|
await setup_platform(hass, config_entry, config)
|
||||||
player = controller.players[1]
|
player = controller.players[1]
|
||||||
# Test set radio preset
|
# Test set radio preset
|
||||||
|
@ -246,7 +246,7 @@ async def test_linked_battery_sensor(hass, hk_driver, caplog):
|
|||||||
|
|
||||||
|
|
||||||
async def test_missing_linked_battery_sensor(hass, hk_driver, caplog):
|
async def test_missing_linked_battery_sensor(hass, hk_driver, caplog):
|
||||||
"""Test battery service with mising linked_battery_sensor."""
|
"""Test battery service with missing linked_battery_sensor."""
|
||||||
entity_id = "homekit.accessory"
|
entity_id = "homekit.accessory"
|
||||||
linked_battery = "sensor.battery"
|
linked_battery = "sensor.battery"
|
||||||
hass.states.async_set(entity_id, "open")
|
hass.states.async_set(entity_id, "open")
|
||||||
|
@ -16,7 +16,7 @@ def create_security_system_service():
|
|||||||
targ_state.value = 0
|
targ_state.value = 0
|
||||||
|
|
||||||
# According to the spec, a battery-level characteristic is normally
|
# According to the spec, a battery-level characteristic is normally
|
||||||
# part of a seperate service. However as the code was written (which
|
# part of a separate service. However as the code was written (which
|
||||||
# predates this test) the battery level would have to be part of the lock
|
# predates this test) the battery level would have to be part of the lock
|
||||||
# service as it is here.
|
# service as it is here.
|
||||||
targ_state = service.add_characteristic("battery-level")
|
targ_state = service.add_characteristic("battery-level")
|
||||||
|
@ -16,7 +16,7 @@ def create_lock_service():
|
|||||||
targ_state.value = 0
|
targ_state.value = 0
|
||||||
|
|
||||||
# According to the spec, a battery-level characteristic is normally
|
# According to the spec, a battery-level characteristic is normally
|
||||||
# part of a seperate service. However as the code was written (which
|
# part of a separate service. However as the code was written (which
|
||||||
# predates this test) the battery level would have to be part of the lock
|
# predates this test) the battery level would have to be part of the lock
|
||||||
# service as it is here.
|
# service as it is here.
|
||||||
targ_state = service.add_characteristic("battery-level")
|
targ_state = service.add_characteristic("battery-level")
|
||||||
|
@ -215,7 +215,7 @@ async def test_flow_link_timeout(hass):
|
|||||||
|
|
||||||
|
|
||||||
async def test_flow_link_unknown_error(hass):
|
async def test_flow_link_unknown_error(hass):
|
||||||
"""Test if a unknown error happend during the linking processes."""
|
"""Test if a unknown error happened during the linking processes."""
|
||||||
mock_bridge = get_mock_bridge(mock_create_user=CoroutineMock(side_effect=OSError),)
|
mock_bridge = get_mock_bridge(mock_create_user=CoroutineMock(side_effect=OSError),)
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.hue.config_flow.discover_nupnp",
|
"homeassistant.components.hue.config_flow.discover_nupnp",
|
||||||
|
@ -307,7 +307,7 @@ async def test_restore_state(hass):
|
|||||||
|
|
||||||
|
|
||||||
async def test_default_value(hass):
|
async def test_default_value(hass):
|
||||||
"""Test default value if none has been set via inital or restore state."""
|
"""Test default value if none has been set via initial or restore state."""
|
||||||
await async_setup_component(
|
await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
|
@ -179,7 +179,7 @@ async def test_name_exists(hass, api):
|
|||||||
|
|
||||||
|
|
||||||
async def test_connection_error(hass, conn_error):
|
async def test_connection_error(hass, conn_error):
|
||||||
"""Test error when connection is unsuccesful."""
|
"""Test error when connection is unsuccessful."""
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
mikrotik.DOMAIN, context={"source": "user"}
|
mikrotik.DOMAIN, context={"source": "user"}
|
||||||
|
@ -16,7 +16,7 @@ async def test_setup_with_no_config(hass):
|
|||||||
|
|
||||||
|
|
||||||
async def test_successful_config_entry(hass):
|
async def test_successful_config_entry(hass):
|
||||||
"""Test config entry successfull setup."""
|
"""Test config entry successful setup."""
|
||||||
entry = MockConfigEntry(domain=mikrotik.DOMAIN, data=MOCK_DATA,)
|
entry = MockConfigEntry(domain=mikrotik.DOMAIN, data=MOCK_DATA,)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
mock_registry = Mock()
|
mock_registry = Mock()
|
||||||
|
@ -50,7 +50,7 @@ async def test_user_connection_works(hass, mock_try_connection, mock_finish_setu
|
|||||||
|
|
||||||
|
|
||||||
async def test_user_connection_fails(hass, mock_try_connection, mock_finish_setup):
|
async def test_user_connection_fails(hass, mock_try_connection, mock_finish_setup):
|
||||||
"""Test if connnection cannot be made."""
|
"""Test if connection cannot be made."""
|
||||||
mock_try_connection.return_value = False
|
mock_try_connection.return_value = False
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
|
@ -229,7 +229,7 @@ async def test_discovery_expansion(hass, mqtt_mock, caplog):
|
|||||||
' "name":"DiscoveryExpansionTest1 Device",'
|
' "name":"DiscoveryExpansionTest1 Device",'
|
||||||
' "mdl":"Generic",'
|
' "mdl":"Generic",'
|
||||||
' "sw":"1.2.3.4",'
|
' "sw":"1.2.3.4",'
|
||||||
' "mf":"Noone"'
|
' "mf":"None"'
|
||||||
" }"
|
" }"
|
||||||
"}"
|
"}"
|
||||||
)
|
)
|
||||||
|
@ -7,7 +7,7 @@ from tests.common import load_fixture
|
|||||||
|
|
||||||
|
|
||||||
async def test_entity_registry(hass, requests_mock):
|
async def test_entity_registry(hass, requests_mock):
|
||||||
"""Tests that the devices are registed in the entity registry."""
|
"""Tests that the devices are registered in the entity registry."""
|
||||||
await setup_platform(hass, LIGHT_DOMAIN)
|
await setup_platform(hass, LIGHT_DOMAIN)
|
||||||
entity_registry = await hass.helpers.entity_registry.async_get_registry()
|
entity_registry = await hass.helpers.entity_registry.async_get_registry()
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ from tests.common import load_fixture
|
|||||||
|
|
||||||
|
|
||||||
async def test_entity_registry(hass, requests_mock):
|
async def test_entity_registry(hass, requests_mock):
|
||||||
"""Tests that the devices are registed in the entity registry."""
|
"""Tests that the devices are registered in the entity registry."""
|
||||||
await setup_platform(hass, SWITCH_DOMAIN)
|
await setup_platform(hass, SWITCH_DOMAIN)
|
||||||
entity_registry = await hass.helpers.entity_registry.async_get_registry()
|
entity_registry = await hass.helpers.entity_registry.async_get_registry()
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ async def test_setup_hass(hass: HomeAssistant, aioclient_mock) -> None:
|
|||||||
|
|
||||||
|
|
||||||
async def test_setup_plattform(hass):
|
async def test_setup_plattform(hass):
|
||||||
"""Test that setup plattform does nothing."""
|
"""Test that setup platform does nothing."""
|
||||||
assert await weather_smhi.async_setup_platform(hass, None, None) is None
|
assert await weather_smhi.async_setup_platform(hass, None, None) is None
|
||||||
|
|
||||||
|
|
||||||
|
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