* Create Opower integration * fix tests * Update config_flow.py * Update coordinator.py * Update sensor.py * Update sensor.py * Update coordinator.py * Bump opower==0.0.4 * Ignore errors for "recent" PGE accounts * Add type for forecasts * Bump opower to 0.0.5 * Bump opower to 0.0.6 * Bump opower to 0.0.7 * Update requirements_all.txt * Update requirements_test_all.txt * Update coordinator Fix exception caused by https://github.com/home-assistant/core/pull/92095 {} is dict but the function expects a set so change it to set() * Improve exceptions handling * Bump opower==0.0.9 * Bump opower to 0.0.10 * Bump opower to 0.0.11 * fix issue when integration hasn't run for 30 days use last stat time instead of now when fetching recent usage/cost * Allow username to be changed in reauth * Don't allow changing username in reauth flow
25 lines
790 B
Python
25 lines
790 B
Python
"""Fixtures for the Opower integration tests."""
|
|
import pytest
|
|
|
|
from homeassistant.components.opower.const import DOMAIN
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry:
|
|
"""Return the default mocked config entry."""
|
|
config_entry = MockConfigEntry(
|
|
title="Pacific Gas & Electric (test-username)",
|
|
domain=DOMAIN,
|
|
data={
|
|
"utility": "Pacific Gas and Electric Company (PG&E)",
|
|
"username": "test-username",
|
|
"password": "test-password",
|
|
},
|
|
state=ConfigEntryState.LOADED,
|
|
)
|
|
config_entry.add_to_hass(hass)
|
|
return config_entry
|