mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fully remove Avri integration (#44478)
* Fully remove Avri integration * Remove avri from .coveragerc
This commit is contained in:
parent
71c9007e06
commit
1f27fb4644
@ -73,8 +73,6 @@ omit =
|
|||||||
homeassistant/components/aurora_abb_powerone/sensor.py
|
homeassistant/components/aurora_abb_powerone/sensor.py
|
||||||
homeassistant/components/avea/light.py
|
homeassistant/components/avea/light.py
|
||||||
homeassistant/components/avion/light.py
|
homeassistant/components/avion/light.py
|
||||||
homeassistant/components/avri/const.py
|
|
||||||
homeassistant/components/avri/sensor.py
|
|
||||||
homeassistant/components/azure_devops/__init__.py
|
homeassistant/components/azure_devops/__init__.py
|
||||||
homeassistant/components/azure_devops/const.py
|
homeassistant/components/azure_devops/const.py
|
||||||
homeassistant/components/azure_devops/sensor.py
|
homeassistant/components/azure_devops/sensor.py
|
||||||
|
@ -54,7 +54,6 @@ homeassistant/components/aurora_abb_powerone/* @davet2001
|
|||||||
homeassistant/components/auth/* @home-assistant/core
|
homeassistant/components/auth/* @home-assistant/core
|
||||||
homeassistant/components/automation/* @home-assistant/core
|
homeassistant/components/automation/* @home-assistant/core
|
||||||
homeassistant/components/avea/* @pattyland
|
homeassistant/components/avea/* @pattyland
|
||||||
homeassistant/components/avri/* @timvancann
|
|
||||||
homeassistant/components/awair/* @ahayworth @danielsjf
|
homeassistant/components/awair/* @ahayworth @danielsjf
|
||||||
homeassistant/components/aws/* @awarecan
|
homeassistant/components/aws/* @awarecan
|
||||||
homeassistant/components/axis/* @Kane610
|
homeassistant/components/axis/* @Kane610
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "This address is already configured."
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Unknown 2 letter country code.",
|
|
||||||
"invalid_house_number": "Invalid house number."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "2 Letter country code",
|
|
||||||
"house_number": "House number",
|
|
||||||
"house_number_extension": "House number extension",
|
|
||||||
"zip_code": "Zip code"
|
|
||||||
},
|
|
||||||
"description": "Enter your address",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Dit adres is reeds geconfigureerd."
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Onbekende landcode",
|
|
||||||
"invalid_house_number": "Ongeldig huisnummer."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "2 Letter landcode",
|
|
||||||
"house_number": "Huisnummer",
|
|
||||||
"house_number_extension": "Huisnummer toevoeging",
|
|
||||||
"zip_code": "Postcode"
|
|
||||||
},
|
|
||||||
"description": "Vul je adres in.",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
"""The avri component."""
|
|
||||||
import asyncio
|
|
||||||
from datetime import timedelta
|
|
||||||
|
|
||||||
from avri.api import Avri
|
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
|
||||||
from homeassistant.core import HomeAssistant
|
|
||||||
|
|
||||||
from .const import (
|
|
||||||
CONF_COUNTRY_CODE,
|
|
||||||
CONF_HOUSE_NUMBER,
|
|
||||||
CONF_HOUSE_NUMBER_EXTENSION,
|
|
||||||
CONF_ZIP_CODE,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
|
|
||||||
PLATFORMS = ["sensor"]
|
|
||||||
SCAN_INTERVAL = timedelta(hours=4)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: dict):
|
|
||||||
"""Set up the Avri component."""
|
|
||||||
hass.data[DOMAIN] = {}
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|
||||||
"""Set up Avri from a config entry."""
|
|
||||||
client = Avri(
|
|
||||||
postal_code=entry.data[CONF_ZIP_CODE],
|
|
||||||
house_nr=entry.data[CONF_HOUSE_NUMBER],
|
|
||||||
house_nr_extension=entry.data.get(CONF_HOUSE_NUMBER_EXTENSION),
|
|
||||||
country_code=entry.data[CONF_COUNTRY_CODE],
|
|
||||||
)
|
|
||||||
|
|
||||||
hass.data[DOMAIN][entry.entry_id] = client
|
|
||||||
|
|
||||||
for component in PLATFORMS:
|
|
||||||
hass.async_create_task(
|
|
||||||
hass.config_entries.async_forward_entry_setup(entry, component)
|
|
||||||
)
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|
||||||
"""Unload a config entry."""
|
|
||||||
unload_ok = all(
|
|
||||||
await asyncio.gather(
|
|
||||||
*[
|
|
||||||
hass.config_entries.async_forward_entry_unload(entry, component)
|
|
||||||
for component in PLATFORMS
|
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if unload_ok:
|
|
||||||
hass.data[DOMAIN].pop(entry.entry_id)
|
|
||||||
|
|
||||||
return unload_ok
|
|
@ -1,76 +0,0 @@
|
|||||||
"""Config flow for Avri component."""
|
|
||||||
import pycountry
|
|
||||||
import voluptuous as vol
|
|
||||||
|
|
||||||
from homeassistant import config_entries
|
|
||||||
from homeassistant.const import CONF_ID
|
|
||||||
|
|
||||||
from .const import (
|
|
||||||
CONF_COUNTRY_CODE,
|
|
||||||
CONF_HOUSE_NUMBER,
|
|
||||||
CONF_HOUSE_NUMBER_EXTENSION,
|
|
||||||
CONF_ZIP_CODE,
|
|
||||||
DEFAULT_COUNTRY_CODE,
|
|
||||||
)
|
|
||||||
from .const import DOMAIN # pylint:disable=unused-import
|
|
||||||
|
|
||||||
DATA_SCHEMA = vol.Schema(
|
|
||||||
{
|
|
||||||
vol.Required(CONF_ZIP_CODE): str,
|
|
||||||
vol.Required(CONF_HOUSE_NUMBER): int,
|
|
||||||
vol.Optional(CONF_HOUSE_NUMBER_EXTENSION): str,
|
|
||||||
vol.Optional(CONF_COUNTRY_CODE, default=DEFAULT_COUNTRY_CODE): str,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class AvriConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|
||||||
"""Avri config flow."""
|
|
||||||
|
|
||||||
VERSION = 1
|
|
||||||
|
|
||||||
async def _show_setup_form(self, errors=None):
|
|
||||||
"""Show the setup form to the user."""
|
|
||||||
return self.async_show_form(
|
|
||||||
step_id="user",
|
|
||||||
data_schema=DATA_SCHEMA,
|
|
||||||
errors=errors or {},
|
|
||||||
)
|
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None):
|
|
||||||
"""Handle the initial step."""
|
|
||||||
if user_input is None:
|
|
||||||
return await self._show_setup_form()
|
|
||||||
|
|
||||||
zip_code = user_input[CONF_ZIP_CODE].replace(" ", "").upper()
|
|
||||||
|
|
||||||
errors = {}
|
|
||||||
if user_input[CONF_HOUSE_NUMBER] <= 0:
|
|
||||||
errors[CONF_HOUSE_NUMBER] = "invalid_house_number"
|
|
||||||
return await self._show_setup_form(errors)
|
|
||||||
if not pycountry.countries.get(alpha_2=user_input[CONF_COUNTRY_CODE]):
|
|
||||||
errors[CONF_COUNTRY_CODE] = "invalid_country_code"
|
|
||||||
return await self._show_setup_form(errors)
|
|
||||||
|
|
||||||
unique_id = (
|
|
||||||
f"{zip_code}"
|
|
||||||
f" "
|
|
||||||
f"{user_input[CONF_HOUSE_NUMBER]}"
|
|
||||||
f'{user_input.get(CONF_HOUSE_NUMBER_EXTENSION, "")}'
|
|
||||||
)
|
|
||||||
|
|
||||||
await self.async_set_unique_id(unique_id)
|
|
||||||
self._abort_if_unique_id_configured()
|
|
||||||
|
|
||||||
return self.async_create_entry(
|
|
||||||
title=unique_id,
|
|
||||||
data={
|
|
||||||
CONF_ID: unique_id,
|
|
||||||
CONF_ZIP_CODE: zip_code,
|
|
||||||
CONF_HOUSE_NUMBER: user_input[CONF_HOUSE_NUMBER],
|
|
||||||
CONF_HOUSE_NUMBER_EXTENSION: user_input.get(
|
|
||||||
CONF_HOUSE_NUMBER_EXTENSION, ""
|
|
||||||
),
|
|
||||||
CONF_COUNTRY_CODE: user_input[CONF_COUNTRY_CODE],
|
|
||||||
},
|
|
||||||
)
|
|
@ -1,8 +0,0 @@
|
|||||||
"""Constants for the Avri integration."""
|
|
||||||
CONF_COUNTRY_CODE = "country_code"
|
|
||||||
CONF_ZIP_CODE = "zip_code"
|
|
||||||
CONF_HOUSE_NUMBER = "house_number"
|
|
||||||
CONF_HOUSE_NUMBER_EXTENSION = "house_number_extension"
|
|
||||||
DOMAIN = "avri"
|
|
||||||
ICON = "mdi:trash-can-outline"
|
|
||||||
DEFAULT_COUNTRY_CODE = "NL"
|
|
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"domain": "avri",
|
|
||||||
"name": "Avri",
|
|
||||||
"documentation": "https://www.home-assistant.io/integrations/avri",
|
|
||||||
"requirements": [
|
|
||||||
"avri-api==0.1.7",
|
|
||||||
"pycountry==19.8.18"
|
|
||||||
],
|
|
||||||
"codeowners": [
|
|
||||||
"@timvancann"
|
|
||||||
],
|
|
||||||
"config_flow": true
|
|
||||||
}
|
|
@ -1,99 +0,0 @@
|
|||||||
"""Support for Avri waste curbside collection pickup."""
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from avri.api import Avri, AvriException
|
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
|
||||||
from homeassistant.const import CONF_ID, DEVICE_CLASS_TIMESTAMP
|
|
||||||
from homeassistant.exceptions import PlatformNotReady
|
|
||||||
from homeassistant.helpers.entity import Entity
|
|
||||||
from homeassistant.helpers.typing import HomeAssistantType
|
|
||||||
|
|
||||||
from .const import DOMAIN, ICON
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
|
||||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
|
|
||||||
) -> None:
|
|
||||||
"""Set up the Avri Waste platform."""
|
|
||||||
client = hass.data[DOMAIN][entry.entry_id]
|
|
||||||
integration_id = entry.data[CONF_ID]
|
|
||||||
|
|
||||||
try:
|
|
||||||
each_upcoming = await hass.async_add_executor_job(client.upcoming_of_each)
|
|
||||||
except AvriException as ex:
|
|
||||||
raise PlatformNotReady from ex
|
|
||||||
else:
|
|
||||||
entities = [
|
|
||||||
AvriWasteUpcoming(client, upcoming.name, integration_id)
|
|
||||||
for upcoming in each_upcoming
|
|
||||||
]
|
|
||||||
async_add_entities(entities, True)
|
|
||||||
|
|
||||||
|
|
||||||
class AvriWasteUpcoming(Entity):
|
|
||||||
"""Avri Waste Sensor."""
|
|
||||||
|
|
||||||
def __init__(self, client: Avri, waste_type: str, integration_id: str):
|
|
||||||
"""Initialize the sensor."""
|
|
||||||
self._waste_type = waste_type
|
|
||||||
self._name = f"{self._waste_type}".title()
|
|
||||||
self._state = None
|
|
||||||
self._client = client
|
|
||||||
self._state_available = False
|
|
||||||
self._integration_id = integration_id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Return the name of the sensor."""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@property
|
|
||||||
def unique_id(self) -> str:
|
|
||||||
"""Return a unique ID."""
|
|
||||||
return (f"{self._integration_id}" f"-{self._waste_type}").replace(" ", "")
|
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
"""Return the state of the sensor."""
|
|
||||||
return self._state
|
|
||||||
|
|
||||||
@property
|
|
||||||
def available(self):
|
|
||||||
"""Return True if entity is available."""
|
|
||||||
return self._state_available
|
|
||||||
|
|
||||||
@property
|
|
||||||
def device_class(self):
|
|
||||||
"""Return the device class of the sensor."""
|
|
||||||
return DEVICE_CLASS_TIMESTAMP
|
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self):
|
|
||||||
"""Icon to use in the frontend."""
|
|
||||||
return ICON
|
|
||||||
|
|
||||||
async def async_update(self):
|
|
||||||
"""Update the data."""
|
|
||||||
if not self.enabled:
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
pickup_events = self._client.upcoming_of_each()
|
|
||||||
except AvriException as ex:
|
|
||||||
_LOGGER.error(
|
|
||||||
"There was an error retrieving upcoming garbage pickups: %s", ex
|
|
||||||
)
|
|
||||||
self._state_available = False
|
|
||||||
self._state = None
|
|
||||||
else:
|
|
||||||
self._state_available = True
|
|
||||||
matched_events = list(
|
|
||||||
filter(lambda event: event.name == self._waste_type, pickup_events)
|
|
||||||
)
|
|
||||||
if not matched_events:
|
|
||||||
self._state = None
|
|
||||||
else:
|
|
||||||
self._state = matched_events[0].day.date()
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "[%key:common::config_flow::abort::already_configured_location%]"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_house_number": "Invalid house number.",
|
|
||||||
"invalid_country_code": "Unknown 2 letter country code."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"zip_code": "Zip code",
|
|
||||||
"house_number": "House number",
|
|
||||||
"house_number_extension": "House number extension",
|
|
||||||
"country_code": "2 Letter country code"
|
|
||||||
},
|
|
||||||
"description": "Enter your address",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "\u062a\u0645 \u062a\u0643\u0648\u064a\u0646 \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0648\u0627\u0646 \u0628\u0627\u0644\u0641\u0639\u0644."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "La ubicaci\u00f3 ja est\u00e0 configurada"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Codi de pa\u00eds desconegut.",
|
|
||||||
"invalid_house_number": "N\u00famero de casa no v\u00e0lid."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "Codi de pa\u00eds de 2 lletres",
|
|
||||||
"house_number": "N\u00famero de casa",
|
|
||||||
"house_number_extension": "Ampliaci\u00f3 de n\u00famero de casa",
|
|
||||||
"zip_code": "Codi postal"
|
|
||||||
},
|
|
||||||
"description": "Introdueix la teva adre\u00e7a",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Um\u00edst\u011bn\u00ed je ji\u017e nastaveno"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Nezn\u00e1m\u00fd dvoup\u00edsmenn\u00fd k\u00f3d zem\u011b.",
|
|
||||||
"invalid_house_number": "Neplatn\u00e9 \u010d\u00edslo domu."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "2p\u00edsmenn\u00fd k\u00f3d zem\u011b",
|
|
||||||
"house_number": "\u010c\u00edslo domu",
|
|
||||||
"house_number_extension": "Roz\u0161\u00ed\u0159en\u00ed \u010d\u00edsla domu",
|
|
||||||
"zip_code": "PS\u010c"
|
|
||||||
},
|
|
||||||
"description": "Zadejte svou adresu",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Position ist bereits konfiguriert"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_house_number": "Ung\u00fcltige Hausnummer"
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"house_number": "Hausnummer",
|
|
||||||
"zip_code": "Postleitzahl"
|
|
||||||
},
|
|
||||||
"description": "Gibt deine Adresse ein",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Location is already configured"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Unknown 2 letter country code.",
|
|
||||||
"invalid_house_number": "Invalid house number."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "2 Letter country code",
|
|
||||||
"house_number": "House number",
|
|
||||||
"house_number_extension": "House number extension",
|
|
||||||
"zip_code": "Zip code"
|
|
||||||
},
|
|
||||||
"description": "Enter your address",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Esta direcci\u00f3n ya est\u00e1 configurada."
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "C\u00f3digo de pa\u00eds de 2 letras desconocido.",
|
|
||||||
"invalid_house_number": "N\u00famero de casa no v\u00e1lido."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "C\u00f3digo de pa\u00eds de 2 letras",
|
|
||||||
"house_number": "N\u00famero de casa",
|
|
||||||
"house_number_extension": "Extensi\u00f3n del n\u00famero de casa",
|
|
||||||
"zip_code": "C\u00f3digo postal"
|
|
||||||
},
|
|
||||||
"description": "Introduce tu direccion",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Aadress on juba m\u00e4\u00e4ratud"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Tundmatu kahet\u00e4heline riigikood.",
|
|
||||||
"invalid_house_number": "Tundmatu majanumber."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "Kahet\u00e4heline riigikood",
|
|
||||||
"house_number": "Maja number",
|
|
||||||
"house_number_extension": "Maja numbri laiendus",
|
|
||||||
"zip_code": "Postiindeks"
|
|
||||||
},
|
|
||||||
"description": "Sisesta oma aadress",
|
|
||||||
"title": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Cette adresse est d\u00e9j\u00e0 configur\u00e9e."
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Code pays \u00e0 2 lettres inconnu.",
|
|
||||||
"invalid_house_number": "Num\u00e9ro de maison invalide."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "Code pays \u00e0 2 lettres",
|
|
||||||
"house_number": "Num\u00e9ro de maison",
|
|
||||||
"house_number_extension": "Extension de num\u00e9ro de maison",
|
|
||||||
"zip_code": "Code postal"
|
|
||||||
},
|
|
||||||
"description": "Entrez votre adresse",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "La posizione \u00e8 gi\u00e0 configurata"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Codice paese di 2 lettere sconosciuto.",
|
|
||||||
"invalid_house_number": "Numero civico non valido."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "Codice paese di 2 lettere",
|
|
||||||
"house_number": "Numero civico",
|
|
||||||
"house_number_extension": "Estensione del numero civico",
|
|
||||||
"zip_code": "Codice di avviamento postale"
|
|
||||||
},
|
|
||||||
"description": "Inserisci il tuo indirizzo",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "\uc774 \uc8fc\uc18c\ub294 \uc774\ubbf8 \uad6c\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4."
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "\uc54c \uc218 \uc5c6\ub294 \uad6d\uac00\ucf54\ub4dc\uc785\ub2c8\ub2e4.",
|
|
||||||
"invalid_house_number": "\uc9d1 \ubc88\ud638\uac00 \uc798\ubabb\ub418\uc5c8\uc2b5\ub2c8\ub2e4"
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "2 \ubb38\uc790 \uad6d\uac00\ucf54\ub4dc",
|
|
||||||
"house_number": "\uc9d1 \ubc88\ud638",
|
|
||||||
"house_number_extension": "\uc9d1 \ubc88\ud638 \ucd94\uac00\uc815\ubcf4",
|
|
||||||
"zip_code": "\uc6b0\ud3b8 \ubc88\ud638"
|
|
||||||
},
|
|
||||||
"description": "\uc8fc\uc18c\ub97c \uc785\ub825\ud574\uc8fc\uc138\uc694",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Standuert ass scho konfigur\u00e9iert."
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Onbekannte Zweestellege L\u00e4nner Code",
|
|
||||||
"invalid_house_number": "Ong\u00eblteg Haus Nummer"
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "Zweestellege L\u00e4nner Code",
|
|
||||||
"house_number": "Haus Nummer",
|
|
||||||
"house_number_extension": "Haus Nummer Extensioun",
|
|
||||||
"zip_code": "Postleitzuel"
|
|
||||||
},
|
|
||||||
"description": "G\u00ebff deng Adresse un",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Locatie is al geconfigureerd"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Onbekende 2-letterige landcode."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Plasseringen er allerede konfigurert"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Ukjent landskode p\u00e5 2 bokstaver.",
|
|
||||||
"invalid_house_number": "Ugyldig husnummer."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "2 Bokstavs landskode",
|
|
||||||
"house_number": "Husnummer",
|
|
||||||
"house_number_extension": "Utvidelse av husnummer",
|
|
||||||
"zip_code": "Postnummer"
|
|
||||||
},
|
|
||||||
"description": "Skriv inn adressen din",
|
|
||||||
"title": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "Lokalizacja jest ju\u017c skonfigurowana"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "Nieznany dwuliterowy kod kraju",
|
|
||||||
"invalid_house_number": "Nieprawid\u0142owy numer domu"
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "Dwuliterowy kod kraju",
|
|
||||||
"house_number": "Numer domu",
|
|
||||||
"house_number_extension": "Numer mieszkania",
|
|
||||||
"zip_code": "Kod pocztowy"
|
|
||||||
},
|
|
||||||
"description": "Wpisz sw\u00f3j adres",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "A localiza\u00e7\u00e3o j\u00e1 est\u00e1 configurada"
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"zip_code": "C\u00f3digo postal"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430."
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0434\u0432\u0443\u0445\u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0442\u0440\u0430\u043d\u044b.",
|
|
||||||
"invalid_house_number": "\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0434\u043e\u043c\u0430."
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "\u0414\u0432\u0443\u0445\u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0442\u0440\u0430\u043d\u044b",
|
|
||||||
"house_number": "\u041d\u043e\u043c\u0435\u0440 \u0434\u043e\u043c\u0430",
|
|
||||||
"house_number_extension": "\u041b\u0438\u0442\u0435\u0440 \u0434\u043e\u043c\u0430 / \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435",
|
|
||||||
"zip_code": "\u041f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441"
|
|
||||||
},
|
|
||||||
"description": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 Home Assistant \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 Avri.",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"config": {
|
|
||||||
"abort": {
|
|
||||||
"already_configured": "\u5ea7\u6a19\u5df2\u7d93\u8a2d\u5b9a\u5b8c\u6210"
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"invalid_country_code": "\u672a\u77e5\u570b\u78bc\uff08\u5169\u5b57\u6bcd\uff09\u3002",
|
|
||||||
"invalid_house_number": "\u9580\u724c\u865f\u78bc\u932f\u8aa4\u3002"
|
|
||||||
},
|
|
||||||
"step": {
|
|
||||||
"user": {
|
|
||||||
"data": {
|
|
||||||
"country_code": "\u570b\u78bc\uff08\u5169\u5b57\u6bcd\uff09",
|
|
||||||
"house_number": "\u9580\u724c\u865f\u78bc",
|
|
||||||
"house_number_extension": "\u9580\u724c\u865f\u78bc\u5206\u865f",
|
|
||||||
"zip_code": "\u90f5\u905e\u5340\u865f"
|
|
||||||
},
|
|
||||||
"description": "\u8f38\u5165\u5730\u5740",
|
|
||||||
"title": "Avri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,7 +23,6 @@ FLOWS = [
|
|||||||
"atag",
|
"atag",
|
||||||
"august",
|
"august",
|
||||||
"aurora",
|
"aurora",
|
||||||
"avri",
|
|
||||||
"awair",
|
"awair",
|
||||||
"axis",
|
"axis",
|
||||||
"azure_devops",
|
"azure_devops",
|
||||||
|
@ -305,9 +305,6 @@ av==8.0.2
|
|||||||
# homeassistant.components.avion
|
# homeassistant.components.avion
|
||||||
# avion==0.10
|
# avion==0.10
|
||||||
|
|
||||||
# homeassistant.components.avri
|
|
||||||
avri-api==0.1.7
|
|
||||||
|
|
||||||
# homeassistant.components.axis
|
# homeassistant.components.axis
|
||||||
axis==41
|
axis==41
|
||||||
|
|
||||||
@ -1321,9 +1318,6 @@ pycomfoconnect==0.3
|
|||||||
# homeassistant.components.coolmaster
|
# homeassistant.components.coolmaster
|
||||||
pycoolmasternet-async==0.1.2
|
pycoolmasternet-async==0.1.2
|
||||||
|
|
||||||
# homeassistant.components.avri
|
|
||||||
pycountry==19.8.18
|
|
||||||
|
|
||||||
# homeassistant.components.microsoft
|
# homeassistant.components.microsoft
|
||||||
pycsspeechtts==1.0.4
|
pycsspeechtts==1.0.4
|
||||||
|
|
||||||
|
@ -176,9 +176,6 @@ auroranoaa==0.0.2
|
|||||||
# homeassistant.components.stream
|
# homeassistant.components.stream
|
||||||
av==8.0.2
|
av==8.0.2
|
||||||
|
|
||||||
# homeassistant.components.avri
|
|
||||||
avri-api==0.1.7
|
|
||||||
|
|
||||||
# homeassistant.components.axis
|
# homeassistant.components.axis
|
||||||
axis==41
|
axis==41
|
||||||
|
|
||||||
@ -666,9 +663,6 @@ pychromecast==7.6.0
|
|||||||
# homeassistant.components.coolmaster
|
# homeassistant.components.coolmaster
|
||||||
pycoolmasternet-async==0.1.2
|
pycoolmasternet-async==0.1.2
|
||||||
|
|
||||||
# homeassistant.components.avri
|
|
||||||
pycountry==19.8.18
|
|
||||||
|
|
||||||
# homeassistant.components.daikin
|
# homeassistant.components.daikin
|
||||||
pydaikin==2.4.0
|
pydaikin==2.4.0
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
"""Tests for the Avri integration."""
|
|
@ -1,81 +0,0 @@
|
|||||||
"""Test the Avri config flow."""
|
|
||||||
from homeassistant import config_entries, setup
|
|
||||||
from homeassistant.components.avri.const import DOMAIN
|
|
||||||
|
|
||||||
from tests.async_mock import patch
|
|
||||||
|
|
||||||
|
|
||||||
async def test_form(hass):
|
|
||||||
"""Test we get the form."""
|
|
||||||
await setup.async_setup_component(hass, "avri", {})
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
|
||||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
|
||||||
)
|
|
||||||
assert result["type"] == "form"
|
|
||||||
assert result["errors"] == {}
|
|
||||||
|
|
||||||
with patch(
|
|
||||||
"homeassistant.components.avri.async_setup_entry",
|
|
||||||
return_value=True,
|
|
||||||
) as mock_setup_entry:
|
|
||||||
result2 = await hass.config_entries.flow.async_configure(
|
|
||||||
result["flow_id"],
|
|
||||||
{
|
|
||||||
"zip_code": "1234AB",
|
|
||||||
"house_number": 42,
|
|
||||||
"house_number_extension": "",
|
|
||||||
"country_code": "NL",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
assert result2["type"] == "create_entry"
|
|
||||||
assert result2["title"] == "1234AB 42"
|
|
||||||
assert result2["data"] == {
|
|
||||||
"id": "1234AB 42",
|
|
||||||
"zip_code": "1234AB",
|
|
||||||
"house_number": 42,
|
|
||||||
"house_number_extension": "",
|
|
||||||
"country_code": "NL",
|
|
||||||
}
|
|
||||||
await hass.async_block_till_done()
|
|
||||||
assert len(mock_setup_entry.mock_calls) == 1
|
|
||||||
|
|
||||||
|
|
||||||
async def test_form_invalid_house_number(hass):
|
|
||||||
"""Test we handle invalid house number."""
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
|
||||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
|
||||||
)
|
|
||||||
|
|
||||||
result2 = await hass.config_entries.flow.async_configure(
|
|
||||||
result["flow_id"],
|
|
||||||
{
|
|
||||||
"zip_code": "1234AB",
|
|
||||||
"house_number": -1,
|
|
||||||
"house_number_extension": "",
|
|
||||||
"country_code": "NL",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
assert result2["type"] == "form"
|
|
||||||
assert result2["errors"] == {"house_number": "invalid_house_number"}
|
|
||||||
|
|
||||||
|
|
||||||
async def test_form_invalid_country_code(hass):
|
|
||||||
"""Test we handle invalid county code."""
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
|
||||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
|
||||||
)
|
|
||||||
|
|
||||||
result2 = await hass.config_entries.flow.async_configure(
|
|
||||||
result["flow_id"],
|
|
||||||
{
|
|
||||||
"zip_code": "1234AB",
|
|
||||||
"house_number": 42,
|
|
||||||
"house_number_extension": "",
|
|
||||||
"country_code": "foo",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
assert result2["type"] == "form"
|
|
||||||
assert result2["errors"] == {"country_code": "invalid_country_code"}
|
|
Loading…
x
Reference in New Issue
Block a user