Skip to content

Commit 5c3b279

Browse files
thecodefrenck
authored andcommitted
Bump aiowebostv to 0.7.4 (home-assistant#148273)
1 parent 59bcf11 commit 5c3b279

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

homeassistant/components/webostv/config_flow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ async def async_step_pairing(
9898
data = {CONF_HOST: self._host, CONF_CLIENT_SECRET: client.client_key}
9999

100100
if not self._name:
101-
self._name = f"{DEFAULT_NAME} {client.tv_info.system['modelName']}"
101+
if model_name := client.tv_info.system.get("modelName"):
102+
self._name = f"{DEFAULT_NAME} {model_name}"
103+
else:
104+
self._name = DEFAULT_NAME
102105
return self.async_create_entry(title=self._name, data=data)
103106

104107
return self.async_show_form(step_id="pairing", errors=errors)

homeassistant/components/webostv/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"documentation": "https://www.home-assistant.io/integrations/webostv",
77
"iot_class": "local_push",
88
"loggers": ["aiowebostv"],
9-
"requirements": ["aiowebostv==0.7.3"],
9+
"requirements": ["aiowebostv==0.7.4"],
1010
"ssdp": [
1111
{
1212
"st": "urn:lge-com:service:webos-second-screen:1"

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/webostv/test_config_flow.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
import pytest
55

66
from homeassistant import config_entries
7-
from homeassistant.components.webostv.const import CONF_SOURCES, DOMAIN, LIVE_TV_APP_ID
7+
from homeassistant.components.webostv.const import (
8+
CONF_SOURCES,
9+
DEFAULT_NAME,
10+
DOMAIN,
11+
LIVE_TV_APP_ID,
12+
)
813
from homeassistant.config_entries import SOURCE_SSDP
914
from homeassistant.const import CONF_CLIENT_SECRET, CONF_HOST, CONF_SOURCE
1015
from homeassistant.core import HomeAssistant
@@ -63,6 +68,29 @@ async def test_form(hass: HomeAssistant, client) -> None:
6368
assert config_entry.unique_id == FAKE_UUID
6469

6570

71+
async def test_form_no_model_name(hass: HomeAssistant, client) -> None:
72+
"""Test successful user flow without model name."""
73+
client.tv_info.system = {}
74+
result = await hass.config_entries.flow.async_init(
75+
DOMAIN,
76+
context={CONF_SOURCE: config_entries.SOURCE_USER},
77+
data=MOCK_USER_CONFIG,
78+
)
79+
await hass.async_block_till_done()
80+
81+
assert result["type"] is FlowResultType.FORM
82+
assert result["step_id"] == "pairing"
83+
84+
result = await hass.config_entries.flow.async_configure(
85+
result["flow_id"], user_input={}
86+
)
87+
88+
assert result["type"] is FlowResultType.CREATE_ENTRY
89+
assert result["title"] == DEFAULT_NAME
90+
config_entry = result["result"]
91+
assert config_entry.unique_id == FAKE_UUID
92+
93+
6694
@pytest.mark.parametrize(
6795
("apps", "inputs"),
6896
[

0 commit comments

Comments
 (0)