Fix EZVIZ spelling case (#79164)

* Fix EZVIZ spelling case

The vendor seems consistent about all-uppercase spelling, so let's
follow suit.

* Revert changes to translations other than English
This commit is contained in:
Ville Skyttä 2022-09-28 08:41:33 +03:00 committed by GitHub
parent 38f3fa0762
commit b54458dfba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 42 additions and 42 deletions

View file

@ -1,4 +1,4 @@
"""Support for Ezviz camera."""
"""Support for EZVIZ camera."""
import logging
from pyezviz.client import EzvizClient
@ -39,7 +39,7 @@ PLATFORMS = [
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Ezviz from a config entry."""
"""Set up EZVIZ from a config entry."""
hass.data.setdefault(DOMAIN, {})
if not entry.options:
@ -56,7 +56,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# Fetch Entry id of main account and reload it.
for item in hass.config_entries.async_entries():
if item.data.get(CONF_TYPE) == ATTR_TYPE_CLOUD:
_LOGGER.info("Reload Ezviz integration with new camera rtsp entry")
_LOGGER.info("Reload EZVIZ integration with new camera rtsp entry")
await hass.config_entries.async_reload(item.entry_id)
return True
@ -66,7 +66,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
_get_ezviz_client_instance, entry
)
except (InvalidURL, HTTPError, PyEzvizError) as error:
_LOGGER.error("Unable to connect to Ezviz service: %s", str(error))
_LOGGER.error("Unable to connect to EZVIZ service: %s", str(error))
raise ConfigEntryNotReady from error
coordinator = EzvizDataUpdateCoordinator(

View file

@ -1,4 +1,4 @@
"""Support for Ezviz binary sensors."""
"""Support for EZVIZ binary sensors."""
from __future__ import annotations
from homeassistant.components.binary_sensor import (
@ -35,7 +35,7 @@ BINARY_SENSOR_TYPES: dict[str, BinarySensorEntityDescription] = {
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up Ezviz sensors based on a config entry."""
"""Set up EZVIZ sensors based on a config entry."""
coordinator: EzvizDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
DATA_COORDINATOR
]
@ -52,7 +52,7 @@ async def async_setup_entry(
class EzvizBinarySensor(EzvizEntity, BinarySensorEntity):
"""Representation of a Ezviz sensor."""
"""Representation of a EZVIZ sensor."""
def __init__(
self,

View file

@ -57,7 +57,7 @@ async def async_setup_entry(
entry: ConfigEntry,
async_add_entities: entity_platform.AddEntitiesCallback,
) -> None:
"""Set up Ezviz cameras based on a config entry."""
"""Set up EZVIZ cameras based on a config entry."""
coordinator: EzvizDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
DATA_COORDINATOR
@ -73,7 +73,7 @@ async def async_setup_entry(
if item.unique_id == camera and item.source != SOURCE_IGNORE
]
# There seem to be a bug related to localRtspPort in Ezviz API.
# There seem to be a bug related to localRtspPort in EZVIZ API.
local_rtsp_port = (
value["local_rtsp_port"]
if value["local_rtsp_port"] != 0
@ -174,7 +174,7 @@ async def async_setup_entry(
class EzvizCamera(EzvizEntity, Camera):
"""An implementation of a Ezviz security camera."""
"""An implementation of a EZVIZ security camera."""
def __init__(
self,
@ -187,7 +187,7 @@ class EzvizCamera(EzvizEntity, Camera):
local_rtsp_port: int,
ffmpeg_arguments: str | None,
) -> None:
"""Initialize a Ezviz security camera."""
"""Initialize a EZVIZ security camera."""
super().__init__(coordinator, serial)
Camera.__init__(self)
self.stream_options[CONF_USE_WALLCLOCK_AS_TIMESTAMPS] = True

View file

@ -67,7 +67,7 @@ def _test_camera_rtsp_creds(data):
class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Ezviz."""
"""Handle a config flow for EZVIZ."""
VERSION = 1
@ -101,7 +101,7 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
async def _validate_and_create_camera_rtsp(self, data):
"""Try DESCRIBE on RTSP camera with credentials."""
# Get Ezviz cloud credentials from config entry
# Get EZVIZ cloud credentials from config entry
ezviz_client_creds = {
CONF_USERNAME: None,
CONF_PASSWORD: None,
@ -311,14 +311,14 @@ class EzvizConfigFlow(ConfigFlow, domain=DOMAIN):
class EzvizOptionsFlowHandler(OptionsFlow):
"""Handle Ezviz client options."""
"""Handle EZVIZ client options."""
def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize options flow."""
self.config_entry = config_entry
async def async_step_init(self, user_input=None):
"""Manage Ezviz options."""
"""Manage EZVIZ options."""
if user_input is not None:
return self.async_create_entry(title="", data=user_input)

View file

@ -1,7 +1,7 @@
"""Constants for the ezviz integration."""
DOMAIN = "ezviz"
MANUFACTURER = "Ezviz"
MANUFACTURER = "EZVIZ"
# Configuration
ATTR_SERIAL = "serial"

View file

@ -15,12 +15,12 @@ _LOGGER = logging.getLogger(__name__)
class EzvizDataUpdateCoordinator(DataUpdateCoordinator):
"""Class to manage fetching Ezviz data."""
"""Class to manage fetching EZVIZ data."""
def __init__(
self, hass: HomeAssistant, *, api: EzvizClient, api_timeout: int
) -> None:
"""Initialize global Ezviz data updater."""
"""Initialize global EZVIZ data updater."""
self.ezviz_client = api
self._api_timeout = api_timeout
update_interval = timedelta(seconds=30)
@ -28,11 +28,11 @@ class EzvizDataUpdateCoordinator(DataUpdateCoordinator):
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=update_interval)
def _update_data(self) -> dict:
"""Fetch data from Ezviz via camera load function."""
"""Fetch data from EZVIZ via camera load function."""
return self.ezviz_client.load_cameras()
async def _async_update_data(self) -> dict:
"""Fetch data from Ezviz."""
"""Fetch data from EZVIZ."""
try:
async with timeout(self._api_timeout):
return await self.hass.async_add_executor_job(self._update_data)

View file

@ -1,4 +1,4 @@
"""An abstract class common to all Ezviz entities."""
"""An abstract class common to all EZVIZ entities."""
from __future__ import annotations
from typing import Any
@ -11,7 +11,7 @@ from .coordinator import EzvizDataUpdateCoordinator
class EzvizEntity(CoordinatorEntity[EzvizDataUpdateCoordinator], Entity):
"""Generic entity encapsulating common features of Ezviz device."""
"""Generic entity encapsulating common features of EZVIZ device."""
def __init__(
self,

View file

@ -1,6 +1,6 @@
{
"domain": "ezviz",
"name": "Ezviz",
"name": "EZVIZ",
"documentation": "https://www.home-assistant.io/integrations/ezviz",
"dependencies": ["ffmpeg"],
"codeowners": ["@RenierM26", "@baqs"],

View file

@ -1,4 +1,4 @@
"""Support for Ezviz sensors."""
"""Support for EZVIZ sensors."""
from __future__ import annotations
from homeassistant.components.sensor import (
@ -44,7 +44,7 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up Ezviz sensors based on a config entry."""
"""Set up EZVIZ sensors based on a config entry."""
coordinator: EzvizDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
DATA_COORDINATOR
]
@ -61,7 +61,7 @@ async def async_setup_entry(
class EzvizSensor(EzvizEntity, SensorEntity):
"""Representation of a Ezviz sensor."""
"""Representation of a EZVIZ sensor."""
coordinator: EzvizDataUpdateCoordinator

View file

@ -3,7 +3,7 @@
"flow_title": "{serial}",
"step": {
"user": {
"title": "Connect to Ezviz Cloud",
"title": "Connect to EZVIZ Cloud",
"data": {
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]",
@ -11,7 +11,7 @@
}
},
"user_custom_url": {
"title": "Connect to custom Ezviz URL",
"title": "Connect to custom EZVIZ URL",
"description": "Manually specify your region URL",
"data": {
"username": "[%key:common::config_flow::data::username%]",
@ -20,8 +20,8 @@
}
},
"confirm": {
"title": "Discovered Ezviz Camera",
"description": "Enter RTSP credentials for Ezviz camera {serial} with IP {ip_address}",
"title": "Discovered EZVIZ Camera",
"description": "Enter RTSP credentials for EZVIZ camera {serial} with IP {ip_address}",
"data": {
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]"
@ -36,7 +36,7 @@
"abort": {
"already_configured_account": "[%key:common::config_flow::abort::already_configured_account%]",
"unknown": "[%key:common::config_flow::error::unknown%]",
"ezviz_cloud_account_missing": "Ezviz cloud account missing. Please reconfigure Ezviz cloud account"
"ezviz_cloud_account_missing": "EZVIZ cloud account missing. Please reconfigure EZVIZ cloud account"
}
},
"options": {

View file

@ -1,4 +1,4 @@
"""Support for Ezviz Switch sensors."""
"""Support for EZVIZ Switch sensors."""
from __future__ import annotations
from typing import Any
@ -19,7 +19,7 @@ from .entity import EzvizEntity
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up Ezviz switch based on a config entry."""
"""Set up EZVIZ switch based on a config entry."""
coordinator: EzvizDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
DATA_COORDINATOR
]
@ -37,7 +37,7 @@ async def async_setup_entry(
class EzvizSwitch(EzvizEntity, SwitchEntity):
"""Representation of a Ezviz sensor."""
"""Representation of a EZVIZ sensor."""
_attr_device_class = SwitchDeviceClass.SWITCH

View file

@ -2,7 +2,7 @@
"config": {
"abort": {
"already_configured_account": "Account is already configured",
"ezviz_cloud_account_missing": "Ezviz cloud account missing. Please reconfigure Ezviz cloud account",
"ezviz_cloud_account_missing": "EZVIZ cloud account missing. Please reconfigure EZVIZ cloud account",
"unknown": "Unexpected error"
},
"error": {
@ -17,8 +17,8 @@
"password": "Password",
"username": "Username"
},
"description": "Enter RTSP credentials for Ezviz camera {serial} with IP {ip_address}",
"title": "Discovered Ezviz Camera"
"description": "Enter RTSP credentials for EZVIZ camera {serial} with IP {ip_address}",
"title": "Discovered EZVIZ Camera"
},
"user": {
"data": {
@ -26,7 +26,7 @@
"url": "URL",
"username": "Username"
},
"title": "Connect to Ezviz Cloud"
"title": "Connect to EZVIZ Cloud"
},
"user_custom_url": {
"data": {
@ -35,7 +35,7 @@
"username": "Username"
},
"description": "Manually specify your region URL",
"title": "Connect to custom Ezviz URL"
"title": "Connect to custom EZVIZ URL"
}
}
},

View file

@ -1,4 +1,4 @@
"""Tests for the Ezviz integration."""
"""Tests for the EZVIZ integration."""
from unittest.mock import patch
from homeassistant.components.ezviz.const import (
@ -74,7 +74,7 @@ async def init_integration(
options: dict = ENTRY_OPTIONS,
skip_entry_setup: bool = False,
) -> MockConfigEntry:
"""Set up the Ezviz integration in Home Assistant."""
"""Set up the EZVIZ integration in Home Assistant."""
entry = MockConfigEntry(domain=DOMAIN, data=data, options=options)
entry.add_to_hass(hass)

View file

@ -1,4 +1,4 @@
"""Test the Ezviz config flow."""
"""Test the EZVIZ config flow."""
from unittest.mock import patch