diff --git a/API.md b/API.md index 9e14112d4..6f8f7b07f 100644 --- a/API.md +++ b/API.md @@ -579,7 +579,7 @@ return: #### MQTT -This service perform a auto discovery to Home-Assistant. +This service performs an auto discovery to Home-Assistant. - GET `/services/mqtt` ```json diff --git a/hassio/addons/__init__.py b/hassio/addons/__init__.py index 58c728af1..a9d9817b7 100644 --- a/hassio/addons/__init__.py +++ b/hassio/addons/__init__.py @@ -40,11 +40,11 @@ class AddonManager(CoreSysAttributes): return list(self.repositories_obj.values()) def get(self, addon_slug): - """Return a add-on from slug.""" + """Return an add-on from slug.""" return self.addons_obj.get(addon_slug) def from_uuid(self, uuid): - """Return a add-on from uuid.""" + """Return an add-on from uuid.""" for addon in self.list_addons: if addon.is_installed and uuid == addon.uuid: return addon diff --git a/hassio/addons/addon.py b/hassio/addons/addon.py index 4bebda235..55fc10dc9 100644 --- a/hassio/addons/addon.py +++ b/hassio/addons/addon.py @@ -70,7 +70,7 @@ class Addon(CoreSysAttributes): @property def is_installed(self): - """Return True if a addon is installed.""" + """Return True if an addon is installed.""" return self._id in self._data.system @property @@ -164,7 +164,7 @@ class Addon(CoreSysAttributes): @property def uuid(self): - """Return a API token for this add-on.""" + """Return an API token for this add-on.""" if self.is_installed: return self._data.user[self._id][ATTR_UUID] return None @@ -411,7 +411,7 @@ class Addon(CoreSysAttributes): @property def with_icon(self): - """Return True if a icon exists.""" + """Return True if an icon exists.""" return self.path_icon.exists() @property @@ -589,7 +589,7 @@ class Addon(CoreSysAttributes): return True async def install(self): - """Install a addon.""" + """Install an addon.""" if self.sys_arch not in self.supported_arch: _LOGGER.error( "Addon %s not supported on %s", self._id, self.sys_arch) @@ -612,7 +612,7 @@ class Addon(CoreSysAttributes): @check_installed async def uninstall(self): - """Remove a addon.""" + """Remove an addon.""" if not await self.instance.remove(): return False @@ -734,7 +734,7 @@ class Addon(CoreSysAttributes): @check_installed async def snapshot(self, tar_file): - """Snapshot a state of a addon.""" + """Snapshot state of an addon.""" with TemporaryDirectory(dir=str(self.sys_config.path_tmp)) as temp: # store local image if self.need_build and not await \ @@ -773,7 +773,7 @@ class Addon(CoreSysAttributes): return True async def restore(self, tar_file): - """Restore a state of a addon.""" + """Restore state of an addon.""" with TemporaryDirectory(dir=str(self.sys_config.path_tmp)) as temp: # extract snapshot def _extract_tarfile(): diff --git a/hassio/api/addons.py b/hassio/api/addons.py index f382c9116..aa3fbfbc8 100644 --- a/hassio/api/addons.py +++ b/hassio/api/addons.py @@ -42,10 +42,10 @@ class APIAddons(CoreSysAttributes): """Handle rest api for addons functions.""" def _extract_addon(self, request, check_installed=True): - """Return addon and if not exists trow a exception.""" + """Return addon, throw an exception it it doesn't exist.""" addon = self.sys_addons.get(request.match_info.get('addon')) if not addon: - raise RuntimeError("Addon not exists") + raise RuntimeError("Addon does not exist") if check_installed and not addon.is_installed: raise RuntimeError("Addon is not installed") diff --git a/hassio/api/services.py b/hassio/api/services.py index b14e96fee..240079a0b 100644 --- a/hassio/api/services.py +++ b/hassio/api/services.py @@ -10,10 +10,10 @@ class APIServices(CoreSysAttributes): """Handle rest api for services functions.""" def _extract_service(self, request): - """Return service and if not exists trow a exception.""" + """Return service, throw an exception if it doesn't exist.""" service = self.sys_services.get(request.match_info.get('service')) if not service: - raise RuntimeError("Service not exists") + raise RuntimeError("Service does not exist") return service diff --git a/hassio/api/snapshots.py b/hassio/api/snapshots.py index ccada9a4a..fc3be36e5 100644 --- a/hassio/api/snapshots.py +++ b/hassio/api/snapshots.py @@ -49,10 +49,10 @@ class APISnapshots(CoreSysAttributes): """Handle rest api for snapshot functions.""" def _extract_snapshot(self, request): - """Return addon and if not exists trow a exception.""" + """Return snapshot, throw an exception if it doesn't exist.""" snapshot = self.sys_snapshots.get(request.match_info.get('snapshot')) if not snapshot: - raise RuntimeError("Snapshot not exists") + raise RuntimeError("Snapshot does not exist") return snapshot @api_process diff --git a/hassio/api/supervisor.py b/hassio/api/supervisor.py index 176401106..299b7eca1 100644 --- a/hassio/api/supervisor.py +++ b/hassio/api/supervisor.py @@ -119,7 +119,7 @@ class APISupervisor(CoreSysAttributes): @api_process async def reload(self, request): - """Reload addons, config ect.""" + """Reload addons, config etc.""" tasks = [ self.sys_updater.reload(), ] diff --git a/hassio/api/utils.py b/hassio/api/utils.py index ae5921313..7d46fccd6 100644 --- a/hassio/api/utils.py +++ b/hassio/api/utils.py @@ -71,7 +71,7 @@ def api_process_raw(content): def api_return_error(message=None): - """Return a API error message.""" + """Return an API error message.""" return web.json_response({ JSON_RESULT: RESULT_ERROR, JSON_MESSAGE: message, @@ -79,7 +79,7 @@ def api_return_error(message=None): def api_return_ok(data=None): - """Return a API ok answer.""" + """Return an API ok answer.""" return web.json_response({ JSON_RESULT: RESULT_OK, JSON_DATA: data or {}, diff --git a/hassio/coresys.py b/hassio/coresys.py index e8ec6ddd9..a5f84352d 100644 --- a/hassio/coresys.py +++ b/hassio/coresys.py @@ -147,7 +147,7 @@ class CoreSys: @api.setter def api(self, value): - """Set a API object.""" + """Set an API object.""" if self._api: raise RuntimeError("API already set!") self._api = value diff --git a/hassio/docker/interface.py b/hassio/docker/interface.py index 4f063f0bf..3c2a8c879 100644 --- a/hassio/docker/interface.py +++ b/hassio/docker/interface.py @@ -120,7 +120,7 @@ class DockerInterface(CoreSysAttributes): if container.status != 'running': return False - # we run on a old image, stop and start it + # we run on an old image, stop and start it if container.image.id != image.id: return False diff --git a/hassio/host/alsa.py b/hassio/host/alsa.py index 75a935192..c34a64f79 100644 --- a/hassio/host/alsa.py +++ b/hassio/host/alsa.py @@ -116,7 +116,7 @@ class AlsaAudio(CoreSysAttributes): return self._default def asound(self, alsa_input=None, alsa_output=None): - """Generate a asound data.""" + """Generate an asound data.""" alsa_input = alsa_input or self.default.input alsa_output = alsa_output or self.default.output diff --git a/hassio/misc/hardware.py b/hassio/misc/hardware.py index fdfca042d..3f60e739d 100644 --- a/hassio/misc/hardware.py +++ b/hassio/misc/hardware.py @@ -24,7 +24,7 @@ RE_TTY = re.compile(r"tty[A-Z]+") class Hardware: - """Represent a interface to procfs, sysfs and udev.""" + """Represent an interface to procfs, sysfs and udev.""" def __init__(self): """Init hardware object.""" diff --git a/hassio/services/discovery.py b/hassio/services/discovery.py index 4914e7c44..dd43505ab 100644 --- a/hassio/services/discovery.py +++ b/hassio/services/discovery.py @@ -56,7 +56,7 @@ class Discovery(CoreSysAttributes): """Send a discovery message to Home-Assistant.""" message = Message(provider, component, platform, config) - # Allready exists? + # Already exists? for exists_message in self.message_obj: if exists_message == message: _LOGGER.warning("Found douplicate discovery message from %s", diff --git a/hassio/snapshots/__init__.py b/hassio/snapshots/__init__.py index 9b5370df7..749e3bb7f 100644 --- a/hassio/snapshots/__init__.py +++ b/hassio/snapshots/__init__.py @@ -92,9 +92,9 @@ class SnapshotManager(CoreSysAttributes): if not await snapshot.load(): return None - # Allready exists? + # Already exists? if snapshot.slug in self.snapshots_obj: - _LOGGER.error("Snapshot %s allready exists!", snapshot.slug) + _LOGGER.error("Snapshot %s already exists!", snapshot.slug) return None # Move snapshot to backup diff --git a/hassio/snapshots/snapshot.py b/hassio/snapshots/snapshot.py index 0888ad177..e737cb72a 100644 --- a/hassio/snapshots/snapshot.py +++ b/hassio/snapshots/snapshot.py @@ -137,7 +137,7 @@ class Snapshot(CoreSysAttributes): self._data[ATTR_CRYPTO] = CRYPTO_AES128 def set_password(self, password): - """Set the password for a exists snapshot.""" + """Set the password for an existing snapshot.""" if not password: return False @@ -210,7 +210,7 @@ class Snapshot(CoreSysAttributes): if not self.tarfile.is_file(): return self - # extract a exists snapshot + # extract an existing snapshot def _extract_snapshot(): """Extract a snapshot.""" with tarfile.open(self.tarfile, "r:") as tar: @@ -252,7 +252,7 @@ class Snapshot(CoreSysAttributes): addon_list = addon_list or self.sys_addons.list_installed async def _addon_save(addon): - """Task to store a add-on into snapshot.""" + """Task to store an add-on into snapshot.""" addon_file = SecureTarFile( Path(self._tmp.name, f"{addon.slug}.tar.gz"), 'w', key=self._key) @@ -285,7 +285,7 @@ class Snapshot(CoreSysAttributes): addon_list.append(addon) async def _addon_restore(addon): - """Task to restore a add-on into snapshot.""" + """Task to restore an add-on into snapshot.""" addon_file = SecureTarFile( Path(self._tmp.name, f"{addon.slug}.tar.gz"), 'r', key=self._key) diff --git a/hassio/snapshots/utils.py b/hassio/snapshots/utils.py index dd7ba16e1..4a842256f 100644 --- a/hassio/snapshots/utils.py +++ b/hassio/snapshots/utils.py @@ -25,7 +25,7 @@ def password_for_validating(password): def key_to_iv(key): - """Generate a iv from Key.""" + """Generate an iv from Key.""" for _ in range(100): key = hashlib.sha256(key).digest() return key[:16] diff --git a/hassio/snapshots/validate.py b/hassio/snapshots/validate.py index cd1d83ee1..3ac714bbe 100644 --- a/hassio/snapshots/validate.py +++ b/hassio/snapshots/validate.py @@ -15,7 +15,7 @@ ALL_FOLDERS = [FOLDER_HOMEASSISTANT, FOLDER_SHARE, FOLDER_ADDONS, FOLDER_SSL] def unique_addons(addons_list): - """Validate that a add-on is unique.""" + """Validate that an add-on is unique.""" single = set([addon[ATTR_SLUG] for addon in addons_list]) if len(single) != len(addons_list): diff --git a/hassio/supervisor.py b/hassio/supervisor.py index 905ff4c46..598113b76 100644 --- a/hassio/supervisor.py +++ b/hassio/supervisor.py @@ -23,7 +23,7 @@ class Supervisor(CoreSysAttributes): @property def need_update(self): - """Return True if a update is available.""" + """Return True if an update is available.""" return self.version != self.last_version @property diff --git a/hassio/tasks.py b/hassio/tasks.py index c68fdd904..c9936d123 100644 --- a/hassio/tasks.py +++ b/hassio/tasks.py @@ -53,7 +53,7 @@ class Tasks(CoreSysAttributes): _LOGGER.info("All core tasks are scheduled") async def _update_addons(self): - """Check if a update is available of a addon and update it.""" + """Check if an update is available for an addon and update it.""" tasks = [] for addon in self.sys_addons.list_addons: if not addon.is_installed or not addon.auto_update: @@ -77,7 +77,7 @@ class Tasks(CoreSysAttributes): if not self.sys_supervisor.need_update: return - # don't perform a update on beta/dev channel + # don't perform an update on beta/dev channel if self.sys_dev: _LOGGER.warning("Ignore Hass.io update on dev channel!") return diff --git a/hassio/utils/tar.py b/hassio/utils/tar.py index 9d13abe0c..102a881eb 100644 --- a/hassio/utils/tar.py +++ b/hassio/utils/tar.py @@ -81,7 +81,7 @@ class SecureTarFile: def _generate_iv(key, salt): - """Generate a iv from data.""" + """Generate an iv from data.""" temp_iv = key + salt for _ in range(100): temp_iv = hashlib.sha256(temp_iv).digest()