Add external Tibber statistics (#62249)

* Tibber, add external statistics

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tibber, add external statistics

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tibber ext stats

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Add tests

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* name

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
This commit is contained in:
Daniel Hjelseth Høyer 2022-01-05 09:33:12 +01:00 committed by GitHub
parent 56520b69ac
commit ba1b09a3a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 180 additions and 11 deletions

View file

@ -7,7 +7,7 @@ from homeassistant import config_entries
from homeassistant.components.tibber.const import DOMAIN
from homeassistant.const import CONF_ACCESS_TOKEN
from tests.common import MockConfigEntry
from tests.common import MockConfigEntry, async_init_recorder_component
@pytest.fixture(name="tibber_setup", autouse=True)
@ -19,6 +19,8 @@ def tibber_setup_fixture():
async def test_show_config_form(hass):
"""Test show configuration form."""
await async_init_recorder_component(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
@ -29,6 +31,8 @@ async def test_show_config_form(hass):
async def test_create_entry(hass):
"""Test create entry from user input."""
await async_init_recorder_component(hass)
test_data = {
CONF_ACCESS_TOKEN: "valid",
}
@ -53,6 +57,8 @@ async def test_create_entry(hass):
async def test_flow_entry_already_exists(hass):
"""Test user input for config_entry that already exists."""
await async_init_recorder_component(hass)
first_entry = MockConfigEntry(
domain="tibber",
data={CONF_ACCESS_TOKEN: "valid"},