mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Emoncms remove useless var in tests (#144942)
This commit is contained in:
parent
9c4733595a
commit
7c306acd5d
@ -7,14 +7,7 @@ from unittest.mock import AsyncMock, patch
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.emoncms.const import CONF_ONLY_INCLUDE_FEEDID, DOMAIN
|
from homeassistant.components.emoncms.const import CONF_ONLY_INCLUDE_FEEDID, DOMAIN
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_API_KEY, CONF_URL
|
||||||
CONF_API_KEY,
|
|
||||||
CONF_ID,
|
|
||||||
CONF_PLATFORM,
|
|
||||||
CONF_URL,
|
|
||||||
CONF_VALUE_TEMPLATE,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.typing import ConfigType
|
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
@ -50,36 +43,6 @@ FLOW_RESULT = {
|
|||||||
|
|
||||||
SENSOR_NAME = "emoncms@1.1.1.1"
|
SENSOR_NAME = "emoncms@1.1.1.1"
|
||||||
|
|
||||||
YAML_BASE = {
|
|
||||||
CONF_PLATFORM: "emoncms",
|
|
||||||
CONF_API_KEY: "my_api_key",
|
|
||||||
CONF_ID: 1,
|
|
||||||
CONF_URL: "http://1.1.1.1",
|
|
||||||
}
|
|
||||||
|
|
||||||
YAML = {
|
|
||||||
**YAML_BASE,
|
|
||||||
CONF_ONLY_INCLUDE_FEEDID: [1],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def emoncms_yaml_config() -> ConfigType:
|
|
||||||
"""Mock emoncms yaml configuration."""
|
|
||||||
return {"sensor": YAML}
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def emoncms_yaml_config_with_template() -> ConfigType:
|
|
||||||
"""Mock emoncms yaml conf with template parameter."""
|
|
||||||
return {"sensor": {**YAML, CONF_VALUE_TEMPLATE: "{{ value | float + 1500 }}"}}
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def emoncms_yaml_config_no_include_only_feed_id() -> ConfigType:
|
|
||||||
"""Mock emoncms yaml configuration without include_only_feed_id parameter."""
|
|
||||||
return {"sensor": YAML_BASE}
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def config_entry() -> MockConfigEntry:
|
def config_entry() -> MockConfigEntry:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user