Rename otbr integration (#86284)

Rename otbr integration
This commit is contained in:
Erik Montnemery 2023-01-20 14:32:41 +01:00 committed by GitHub
parent d94f007dbf
commit ae39b95bb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 24 deletions

View File

@ -14,7 +14,7 @@ from .const import DOMAIN
class OTBRConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Home Assistant SkyConnect."""
"""Handle a config flow for Open Thread Border Router."""
VERSION = 1
@ -37,7 +37,7 @@ class OTBRConfigFlow(ConfigFlow, domain=DOMAIN):
else:
await self.async_set_unique_id(DOMAIN)
return self.async_create_entry(
title="Thread",
title="Open Thread Border Router",
data=user_input,
)
@ -55,6 +55,6 @@ class OTBRConfigFlow(ConfigFlow, domain=DOMAIN):
url = f"http://{config['host']}:{config['port']}"
await self.async_set_unique_id(DOMAIN)
return self.async_create_entry(
title="Thread",
title="Open Thread Border Router",
data={"url": url},
)

View File

@ -1,6 +1,6 @@
{
"domain": "otbr",
"name": "Thread",
"name": "Open Thread Border Router",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/otbr",
"requirements": ["python-otbr-api==1.0.1"],

View File

@ -3966,7 +3966,7 @@
"iot_class": "local_polling"
},
"otbr": {
"name": "Thread",
"name": "Open Thread Border Router",
"integration_type": "service",
"config_flow": true,
"iot_class": "local_polling"

View File

@ -1,2 +1,2 @@
"""Tests for the Thread integration."""
"""Tests for the Open Thread Border Router integration."""
BASE_URL = "http://core-silabs-multiprotocol:8081"

View File

@ -1,4 +1,4 @@
"""Test fixtures for the Home Assistant SkyConnect integration."""
"""Test fixtures for the Open Thread Border Router integration."""
from unittest.mock import patch
import pytest
@ -10,14 +10,14 @@ from tests.common import MockConfigEntry
CONFIG_ENTRY_DATA = {"url": "http://core-silabs-multiprotocol:8081"}
@pytest.fixture(name="thread_config_entry")
async def thread_config_entry_fixture(hass):
"""Mock Thread config entry."""
@pytest.fixture(name="otbr_config_entry")
async def otbr_config_entry_fixture(hass):
"""Mock Open Thread Border Router config entry."""
config_entry = MockConfigEntry(
data=CONFIG_ENTRY_DATA,
domain=otbr.DOMAIN,
options={},
title="Thread",
title="Open Thread Border Router",
)
config_entry.add_to_hass(hass)
with patch("python_otbr_api.OTBR.get_active_dataset_tlvs"):

View File

@ -44,7 +44,7 @@ async def test_user_flow(
},
)
assert result["type"] == FlowResultType.CREATE_ENTRY
assert result["title"] == "Thread"
assert result["title"] == "Open Thread Border Router"
assert result["data"] == expected_data
assert result["options"] == {}
assert len(mock_setup_entry.mock_calls) == 1
@ -52,7 +52,7 @@ async def test_user_flow(
config_entry = hass.config_entries.async_entries(otbr.DOMAIN)[0]
assert config_entry.data == expected_data
assert config_entry.options == {}
assert config_entry.title == "Thread"
assert config_entry.title == "Open Thread Border Router"
assert config_entry.unique_id == otbr.DOMAIN
@ -94,7 +94,7 @@ async def test_hassio_discovery_flow(hass: HomeAssistant) -> None:
}
assert result["type"] == FlowResultType.CREATE_ENTRY
assert result["title"] == "Thread"
assert result["title"] == "Open Thread Border Router"
assert result["data"] == expected_data
assert result["options"] == {}
assert len(mock_setup_entry.mock_calls) == 1
@ -102,7 +102,7 @@ async def test_hassio_discovery_flow(hass: HomeAssistant) -> None:
config_entry = hass.config_entries.async_entries(otbr.DOMAIN)[0]
assert config_entry.data == expected_data
assert config_entry.options == {}
assert config_entry.title == "Thread"
assert config_entry.title == "Open Thread Border Router"
assert config_entry.unique_id == otbr.DOMAIN
@ -116,7 +116,7 @@ async def test_config_flow_single_entry(hass: HomeAssistant, source: str) -> Non
data={},
domain=otbr.DOMAIN,
options={},
title="Thread",
title="Open Thread Border Router",
)
config_entry.add_to_hass(hass)

View File

@ -14,7 +14,7 @@ from tests.test_util.aiohttp import AiohttpClientMocker
async def test_remove_entry(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, thread_config_entry
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, otbr_config_entry
):
"""Test async_get_thread_state."""
@ -30,7 +30,7 @@ async def test_remove_entry(
async def test_get_active_dataset_tlvs(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, thread_config_entry
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, otbr_config_entry
):
"""Test async_get_active_dataset_tlvs."""
@ -48,7 +48,7 @@ async def test_get_active_dataset_tlvs(
async def test_get_active_dataset_tlvs_empty(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, thread_config_entry
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, otbr_config_entry
):
"""Test async_get_active_dataset_tlvs."""
@ -64,7 +64,7 @@ async def test_get_active_dataset_tlvs_addon_not_installed(hass: HomeAssistant):
async def test_get_active_dataset_tlvs_404(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, thread_config_entry
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, otbr_config_entry
):
"""Test async_get_active_dataset_tlvs with error."""
@ -74,7 +74,7 @@ async def test_get_active_dataset_tlvs_404(
async def test_get_active_dataset_tlvs_201(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, thread_config_entry
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, otbr_config_entry
):
"""Test async_get_active_dataset_tlvs with error."""
@ -84,7 +84,7 @@ async def test_get_active_dataset_tlvs_201(
async def test_get_active_dataset_tlvs_invalid(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, thread_config_entry
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, otbr_config_entry
):
"""Test async_get_active_dataset_tlvs with error."""

View File

@ -21,7 +21,7 @@ async def websocket_client(hass, hass_ws_client):
async def test_get_info(
hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker,
thread_config_entry,
otbr_config_entry,
websocket_client,
):
"""Test async_get_info."""
@ -73,7 +73,7 @@ async def test_get_info_no_entry(
async def test_get_info_fetch_fails(
hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker,
thread_config_entry,
otbr_config_entry,
websocket_client,
):
"""Test async_get_info."""