Remove griddy integration (#47218)
This commit is contained in:
parent
732db3b67c
commit
2de01ddaeb
35 changed files with 0 additions and 743 deletions
|
@ -180,7 +180,6 @@ homeassistant/components/google_cloud/* @lufton
|
|||
homeassistant/components/gpsd/* @fabaff
|
||||
homeassistant/components/gree/* @cmroche
|
||||
homeassistant/components/greeneye_monitor/* @jkeljo
|
||||
homeassistant/components/griddy/* @bdraco
|
||||
homeassistant/components/group/* @home-assistant/core
|
||||
homeassistant/components/growatt_server/* @indykoning
|
||||
homeassistant/components/guardian/* @bachya
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
"""The Griddy Power integration."""
|
||||
import asyncio
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from griddypower.async_api import LOAD_ZONES, AsyncGriddy
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
from .const import CONF_LOADZONE, DOMAIN, UPDATE_INTERVAL
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema(
|
||||
{DOMAIN: vol.Schema({vol.Required(CONF_LOADZONE): vol.In(LOAD_ZONES)})},
|
||||
extra=vol.ALLOW_EXTRA,
|
||||
)
|
||||
|
||||
PLATFORMS = ["sensor"]
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistant, config: dict):
|
||||
"""Set up the Griddy Power component."""
|
||||
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
conf = config.get(DOMAIN)
|
||||
|
||||
if not conf:
|
||||
return True
|
||||
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_IMPORT},
|
||||
data={CONF_LOADZONE: conf.get(CONF_LOADZONE)},
|
||||
)
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||
"""Set up Griddy Power from a config entry."""
|
||||
|
||||
entry_data = entry.data
|
||||
|
||||
async_griddy = AsyncGriddy(
|
||||
aiohttp_client.async_get_clientsession(hass),
|
||||
settlement_point=entry_data[CONF_LOADZONE],
|
||||
)
|
||||
|
||||
async def async_update_data():
|
||||
"""Fetch data from API endpoint."""
|
||||
return await async_griddy.async_getnow()
|
||||
|
||||
coordinator = DataUpdateCoordinator(
|
||||
hass,
|
||||
_LOGGER,
|
||||
name="Griddy getnow",
|
||||
update_method=async_update_data,
|
||||
update_interval=timedelta(seconds=UPDATE_INTERVAL),
|
||||
)
|
||||
|
||||
await coordinator.async_refresh()
|
||||
|
||||
if not coordinator.last_update_success:
|
||||
raise ConfigEntryNotReady
|
||||
|
||||
hass.data[DOMAIN][entry.entry_id] = coordinator
|
||||
|
||||
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,75 +0,0 @@
|
|||
"""Config flow for Griddy Power integration."""
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from aiohttp import ClientError
|
||||
from griddypower.async_api import LOAD_ZONES, AsyncGriddy
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import config_entries, core, exceptions
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
|
||||
from .const import CONF_LOADZONE
|
||||
from .const import DOMAIN # pylint:disable=unused-import
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DATA_SCHEMA = vol.Schema({vol.Required(CONF_LOADZONE): vol.In(LOAD_ZONES)})
|
||||
|
||||
|
||||
async def validate_input(hass: core.HomeAssistant, data):
|
||||
"""Validate the user input allows us to connect.
|
||||
|
||||
Data has the keys from DATA_SCHEMA with values provided by the user.
|
||||
"""
|
||||
client_session = aiohttp_client.async_get_clientsession(hass)
|
||||
|
||||
try:
|
||||
await AsyncGriddy(
|
||||
client_session, settlement_point=data[CONF_LOADZONE]
|
||||
).async_getnow()
|
||||
except (asyncio.TimeoutError, ClientError) as err:
|
||||
raise CannotConnect from err
|
||||
|
||||
# Return info that you want to store in the config entry.
|
||||
return {"title": f"Load Zone {data[CONF_LOADZONE]}"}
|
||||
|
||||
|
||||
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a config flow for Griddy Power."""
|
||||
|
||||
VERSION = 1
|
||||
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
|
||||
|
||||
async def async_step_user(self, user_input=None):
|
||||
"""Handle the initial step."""
|
||||
errors = {}
|
||||
info = None
|
||||
if user_input is not None:
|
||||
try:
|
||||
info = await validate_input(self.hass, user_input)
|
||||
except CannotConnect:
|
||||
errors["base"] = "cannot_connect"
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_LOGGER.exception("Unexpected exception")
|
||||
errors["base"] = "unknown"
|
||||
|
||||
if "base" not in errors:
|
||||
await self.async_set_unique_id(user_input[CONF_LOADZONE])
|
||||
self._abort_if_unique_id_configured()
|
||||
return self.async_create_entry(title=info["title"], data=user_input)
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="user", data_schema=DATA_SCHEMA, errors=errors
|
||||
)
|
||||
|
||||
async def async_step_import(self, user_input):
|
||||
"""Handle import."""
|
||||
await self.async_set_unique_id(user_input[CONF_LOADZONE])
|
||||
self._abort_if_unique_id_configured()
|
||||
|
||||
return await self.async_step_user(user_input)
|
||||
|
||||
|
||||
class CannotConnect(exceptions.HomeAssistantError):
|
||||
"""Error to indicate we cannot connect."""
|
|
@ -1,7 +0,0 @@
|
|||
"""Constants for the Griddy Power integration."""
|
||||
|
||||
DOMAIN = "griddy"
|
||||
|
||||
UPDATE_INTERVAL = 90
|
||||
|
||||
CONF_LOADZONE = "loadzone"
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"domain": "griddy",
|
||||
"name": "Griddy Power",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/griddy",
|
||||
"requirements": ["griddypower==0.1.0"],
|
||||
"codeowners": ["@bdraco"]
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
"""Support for August sensors."""
|
||||
from homeassistant.const import CURRENCY_CENT, ENERGY_KILO_WATT_HOUR
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
from .const import CONF_LOADZONE, DOMAIN
|
||||
|
||||
|
||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
"""Set up the August sensors."""
|
||||
coordinator = hass.data[DOMAIN][config_entry.entry_id]
|
||||
|
||||
settlement_point = config_entry.data[CONF_LOADZONE]
|
||||
|
||||
async_add_entities([GriddyPriceSensor(settlement_point, coordinator)], True)
|
||||
|
||||
|
||||
class GriddyPriceSensor(CoordinatorEntity):
|
||||
"""Representation of an August sensor."""
|
||||
|
||||
def __init__(self, settlement_point, coordinator):
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(coordinator)
|
||||
self._settlement_point = settlement_point
|
||||
|
||||
@property
|
||||
def unit_of_measurement(self):
|
||||
"""Return the unit of measurement."""
|
||||
return f"{CURRENCY_CENT}/{ENERGY_KILO_WATT_HOUR}"
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Device Name."""
|
||||
return f"{self._settlement_point} Price Now"
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
"""Device Ice."""
|
||||
return "mdi:currency-usd"
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Device Uniqueid."""
|
||||
return f"{self._settlement_point}_price_now"
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""Get the current price."""
|
||||
return round(float(self.coordinator.data.now.price_cents_kwh), 4)
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"error": {
|
||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"description": "Your Load Zone is in your Griddy account under \u201cAccount > Meter > Load Zone.\u201d",
|
||||
"data": { "loadzone": "Load Zone (Settlement Point)" },
|
||||
"title": "Setup your Griddy Load Zone"
|
||||
}
|
||||
},
|
||||
"abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_location%]" }
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "La ubicaci\u00f3 ja est\u00e0 configurada"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Ha fallat la connexi\u00f3",
|
||||
"unknown": "Error inesperat"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Zona de c\u00e0rrega (Load Zone)"
|
||||
},
|
||||
"description": "La teva zona de c\u00e0rrega (Load Zone) est\u00e0 al teu compte de Griddy v\u00e9s a \"Account > Meter > Load Zone\".",
|
||||
"title": "Configuraci\u00f3 de la zona de c\u00e0rrega (Load Zone) de Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Um\u00edst\u011bn\u00ed je ji\u017e nastaveno"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Nepoda\u0159ilo se p\u0159ipojit",
|
||||
"unknown": "Neo\u010dek\u00e1van\u00e1 chyba"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Standort ist bereits konfiguriert"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Verbindung fehlgeschlagen",
|
||||
"unknown": "Unerwarteter Fehler"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Ladezone (Abwicklungspunkt)"
|
||||
},
|
||||
"description": "Ihre Ladezone befindet sich in Ihrem Griddy-Konto unter \"Konto > Messger\u00e4t > Ladezone\".",
|
||||
"title": "Richten Sie Ihre Griddy Ladezone ein"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Location is already configured"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Failed to connect",
|
||||
"unknown": "Unexpected error"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Load Zone (Settlement Point)"
|
||||
},
|
||||
"description": "Your Load Zone is in your Griddy account under \u201cAccount > Meter > Load Zone.\u201d",
|
||||
"title": "Setup your Griddy Load Zone"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Esta zona de carga ya est\u00e1 configurada"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "No se pudo conectar, intente nuevamente",
|
||||
"unknown": "Error inesperado"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Zona de carga (punto de asentamiento)"
|
||||
},
|
||||
"description": "Su zona de carga est\u00e1 en su cuenta de Griddy en \"Cuenta > Medidor > Zona de carga\".",
|
||||
"title": "Configura tu zona de carga Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Esta Zona de Carga ya est\u00e1 configurada"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "No se ha podido conectar, por favor, int\u00e9ntalo de nuevo.",
|
||||
"unknown": "Error inesperado"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Zona de Carga (Punto del Asentamiento)"
|
||||
},
|
||||
"description": "Tu Zona de Carga est\u00e1 en tu cuenta de Griddy en \"Account > Meter > Load Zone\"",
|
||||
"title": "Configurar tu Zona de Carga de Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "See Load Zone on juba m\u00e4\u00e4ratud"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "\u00dchendamine nurjus",
|
||||
"unknown": "Tundmatu viga"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Load Zone (arvelduspunkt)"
|
||||
},
|
||||
"description": "Load Zone asub Griddy konto valikutes \u201cAccount > Meter > Load Zone.\u201d",
|
||||
"title": "Seadista oma Griddy Load Zone"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Cette zone de chargement est d\u00e9j\u00e0 configur\u00e9e"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Impossible de se connecter, veuillez r\u00e9essayer",
|
||||
"unknown": "Erreur inattendue"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Zone de charge (point d'\u00e9tablissement)"
|
||||
},
|
||||
"description": "Votre zone de charge se trouve dans votre compte Griddy sous \"Compte > Compteur > Zone de charge\".",
|
||||
"title": "Configurez votre zone de charge Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "La posizione \u00e8 gi\u00e0 configurata"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Impossibile connettersi",
|
||||
"unknown": "Errore imprevisto"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Zona di Carico (Punto di insediamento)"
|
||||
},
|
||||
"description": "La tua Zona di Carico si trova nel tuo account Griddy in \"Account > Meter > Load zone\".",
|
||||
"title": "Configurazione della Zona di Carico Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "\uc704\uce58\uac00 \uc774\ubbf8 \uad6c\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4."
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "\uc5f0\uacb0\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4",
|
||||
"unknown": "\uc608\uc0c1\uce58 \ubabb\ud55c \uc624\ub958\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "\uc804\ub825 \uacf5\uae09 \uc9c0\uc5ed (\uc815\uc0b0\uc810)"
|
||||
},
|
||||
"description": "\uc804\ub825 \uacf5\uae09 \uc9c0\uc5ed\uc740 Griddy \uacc4\uc815\uc758 \"Account > Meter > Load Zone\"\uc5d0\uc11c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.",
|
||||
"title": "Griddy \uc804\ub825 \uacf5\uae09 \uc9c0\uc5ed \uc124\uc815\ud558\uae30"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Standuert ass scho konfigur\u00e9iert"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Feeler beim verbannen",
|
||||
"unknown": "Onerwaarte Feeler"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Lued Zone (Punkt vum R\u00e9glement)"
|
||||
},
|
||||
"description": "Deng Lued Zon ass an dengem Griddy Kont enner \"Account > Meter > Load Zone.\"",
|
||||
"title": "Griddy Lued Zon ariichten"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Deze laadzone is al geconfigureerd"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Verbinding mislukt, probeer het opnieuw",
|
||||
"unknown": "Onverwachte fout"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Laadzone (vestigingspunt)"
|
||||
},
|
||||
"description": "Uw Load Zone staat op uw Griddy account onder \"Account > Meter > Load Zone\".",
|
||||
"title": "Stel uw Griddy Load Zone in"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Plasseringen er allerede konfigurert"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Tilkobling mislyktes",
|
||||
"unknown": "Uventet feil"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Load Zone (settlingspunkt)"
|
||||
},
|
||||
"description": "Din Load Zone er p\u00e5 din Griddy-konto under \"Konto > M\u00e5ler > Lastesone.\"",
|
||||
"title": "Sett opp din Griddy Load Zone"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Lokalizacja jest ju\u017c skonfigurowana"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Nie mo\u017cna nawi\u0105za\u0107 po\u0142\u0105czenia",
|
||||
"unknown": "Nieoczekiwany b\u0142\u0105d"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Strefa obci\u0105\u017cenia (punkt rozliczenia)"
|
||||
},
|
||||
"description": "Twoja strefa obci\u0105\u017cenia znajduje si\u0119 na twoim koncie Griddy w sekcji \"Konto > Licznik > Strefa obci\u0105\u017cenia\".",
|
||||
"title": "Konfiguracja strefy obci\u0105\u017cenia Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"error": {
|
||||
"cannot_connect": "Falha ao conectar, tente novamente",
|
||||
"unknown": "Erro inesperado"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "A localiza\u00e7\u00e3o j\u00e1 est\u00e1 configurada"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Falha na liga\u00e7\u00e3o",
|
||||
"unknown": "Erro inesperado"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +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": {
|
||||
"cannot_connect": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f.",
|
||||
"unknown": "\u041d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430."
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "\u0417\u043e\u043d\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (\u0440\u0430\u0441\u0447\u0435\u0442\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430)"
|
||||
},
|
||||
"description": "\u0417\u043e\u043d\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0412\u0430\u0448\u0435\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 Griddy \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Account > Meter > Load Zone.",
|
||||
"title": "Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Ta obremenitvena cona je \u017ee konfigurirana"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Povezava ni uspela, poskusite znova",
|
||||
"unknown": "Nepri\u010dakovana napaka"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "Obremenitvena cona (poselitvena to\u010dka)"
|
||||
},
|
||||
"description": "Va\u0161a obremenitvena cona je v va\u0161em ra\u010dunu Griddy pod \"Ra\u010dun > Merilnik > Nalo\u017ei cono.\"",
|
||||
"title": "Nastavite svojo Griddy Load Cono"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"error": {
|
||||
"cannot_connect": "Det gick inte att ansluta, f\u00f6rs\u00f6k igen",
|
||||
"unknown": "Ov\u00e4ntat fel"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "Konum zaten yap\u0131land\u0131r\u0131lm\u0131\u015f"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Ba\u011flant\u0131 kurulamad\u0131, l\u00fctfen tekrar deneyin",
|
||||
"unknown": "Beklenmeyen hata"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u043c\u0456\u0441\u0446\u0435\u0437\u043d\u0430\u0445\u043e\u0434\u0436\u0435\u043d\u043d\u044f \u0432\u0436\u0435 \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u0435."
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0456\u0434'\u0454\u0434\u043d\u0430\u0442\u0438\u0441\u044f",
|
||||
"unknown": "\u041d\u0435\u043e\u0447\u0456\u043a\u0443\u0432\u0430\u043d\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "\u0417\u043e\u043d\u0430 \u043d\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f (\u0440\u043e\u0437\u0440\u0430\u0445\u0443\u043d\u043a\u043e\u0432\u0430 \u0442\u043e\u0447\u043a\u0430)"
|
||||
},
|
||||
"description": "\u0417\u043e\u043d\u0430 \u043d\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0443 \u0432\u0430\u0448\u043e\u043c\u0443 \u043f\u0440\u043e\u0444\u0456\u043b\u0456 Griddy \u0432 \u0440\u043e\u0437\u0434\u0456\u043b\u0456 Account > Meter > Load Zone.",
|
||||
"title": "Griddy"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "\u5ea7\u6a19\u5df2\u7d93\u8a2d\u5b9a\u5b8c\u6210"
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "\u9023\u7dda\u5931\u6557",
|
||||
"unknown": "\u672a\u9810\u671f\u932f\u8aa4"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
"loadzone": "\u8ca0\u8f09\u5340\u57df\uff08\u5c45\u4f4f\u9ede\uff09"
|
||||
},
|
||||
"description": "\u8ca0\u8f09\u5340\u57df\u986f\u793a\u65bc Griddy \u5e33\u865f\uff0c\u4f4d\u65bc \u201cAccount > Meter > Load Zone\u201d\u3002",
|
||||
"title": "\u8a2d\u5b9a Griddy \u8ca0\u8f09\u5340\u57df"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -86,7 +86,6 @@ FLOWS = [
|
|||
"gogogate2",
|
||||
"gpslogger",
|
||||
"gree",
|
||||
"griddy",
|
||||
"guardian",
|
||||
"habitica",
|
||||
"hangouts",
|
||||
|
|
|
@ -705,9 +705,6 @@ greeneye_monitor==2.1
|
|||
# homeassistant.components.greenwave
|
||||
greenwavereality==0.5.1
|
||||
|
||||
# homeassistant.components.griddy
|
||||
griddypower==0.1.0
|
||||
|
||||
# homeassistant.components.growatt_server
|
||||
growattServer==0.1.1
|
||||
|
||||
|
|
|
@ -372,9 +372,6 @@ google-nest-sdm==0.2.12
|
|||
# homeassistant.components.gree
|
||||
greeclimate==0.10.3
|
||||
|
||||
# homeassistant.components.griddy
|
||||
griddypower==0.1.0
|
||||
|
||||
# homeassistant.components.profiler
|
||||
guppy3==3.1.0
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
"""Tests for the Griddy Power integration."""
|
|
@ -1,56 +0,0 @@
|
|||
"""Test the Griddy Power config flow."""
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from homeassistant import config_entries, setup
|
||||
from homeassistant.components.griddy.const import DOMAIN
|
||||
|
||||
|
||||
async def test_form(hass):
|
||||
"""Test we get the form."""
|
||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
||||
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.griddy.config_flow.AsyncGriddy.async_getnow",
|
||||
return_value=MagicMock(),
|
||||
), patch(
|
||||
"homeassistant.components.griddy.async_setup", return_value=True
|
||||
) as mock_setup, patch(
|
||||
"homeassistant.components.griddy.async_setup_entry",
|
||||
return_value=True,
|
||||
) as mock_setup_entry:
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"],
|
||||
{"loadzone": "LZ_HOUSTON"},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result2["type"] == "create_entry"
|
||||
assert result2["title"] == "Load Zone LZ_HOUSTON"
|
||||
assert result2["data"] == {"loadzone": "LZ_HOUSTON"}
|
||||
assert len(mock_setup.mock_calls) == 1
|
||||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_form_cannot_connect(hass):
|
||||
"""Test we handle cannot connect error."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.griddy.config_flow.AsyncGriddy.async_getnow",
|
||||
side_effect=asyncio.TimeoutError,
|
||||
):
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"],
|
||||
{"loadzone": "LZ_NORTH"},
|
||||
)
|
||||
|
||||
assert result2["type"] == "form"
|
||||
assert result2["errors"] == {"base": "cannot_connect"}
|
|
@ -1,39 +0,0 @@
|
|||
"""The sensor tests for the griddy platform."""
|
||||
import json
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
from griddypower.async_api import GriddyPriceData
|
||||
|
||||
from homeassistant.components.griddy import CONF_LOADZONE, DOMAIN
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import load_fixture
|
||||
|
||||
|
||||
async def _load_json_fixture(hass, path):
|
||||
fixture = await hass.async_add_executor_job(
|
||||
load_fixture, os.path.join("griddy", path)
|
||||
)
|
||||
return json.loads(fixture)
|
||||
|
||||
|
||||
def _mock_get_config():
|
||||
"""Return a default griddy config."""
|
||||
return {DOMAIN: {CONF_LOADZONE: "LZ_HOUSTON"}}
|
||||
|
||||
|
||||
async def test_houston_loadzone(hass):
|
||||
"""Test creation of the houston load zone."""
|
||||
|
||||
getnow_json = await _load_json_fixture(hass, "getnow.json")
|
||||
griddy_price_data = GriddyPriceData(getnow_json)
|
||||
with patch(
|
||||
"homeassistant.components.griddy.AsyncGriddy.async_getnow",
|
||||
return_value=griddy_price_data,
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, _mock_get_config())
|
||||
await hass.async_block_till_done()
|
||||
|
||||
sensor_lz_houston_price_now = hass.states.get("sensor.lz_houston_price_now")
|
||||
assert sensor_lz_houston_price_now.state == "1.269"
|
Loading…
Add table
Reference in a new issue