Bump aiowebostv to 0.7.4 (#148273)

This commit is contained in:
Shay Levy 2025-07-07 12:37:39 +03:00 committed by GitHub
parent a5d6bfd1b3
commit f02c1b0d4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 36 additions and 5 deletions

View File

@ -98,7 +98,10 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
data = {CONF_HOST: self._host, CONF_CLIENT_SECRET: client.client_key} data = {CONF_HOST: self._host, CONF_CLIENT_SECRET: client.client_key}
if not self._name: if not self._name:
self._name = f"{DEFAULT_NAME} {client.tv_info.system['modelName']}" if model_name := client.tv_info.system.get("modelName"):
self._name = f"{DEFAULT_NAME} {model_name}"
else:
self._name = DEFAULT_NAME
return self.async_create_entry(title=self._name, data=data) return self.async_create_entry(title=self._name, data=data)
return self.async_show_form(step_id="pairing", errors=errors) return self.async_show_form(step_id="pairing", errors=errors)

View File

@ -6,7 +6,7 @@
"documentation": "https://www.home-assistant.io/integrations/webostv", "documentation": "https://www.home-assistant.io/integrations/webostv",
"iot_class": "local_push", "iot_class": "local_push",
"loggers": ["aiowebostv"], "loggers": ["aiowebostv"],
"requirements": ["aiowebostv==0.7.3"], "requirements": ["aiowebostv==0.7.4"],
"ssdp": [ "ssdp": [
{ {
"st": "urn:lge-com:service:webos-second-screen:1" "st": "urn:lge-com:service:webos-second-screen:1"

2
requirements_all.txt generated
View File

@ -435,7 +435,7 @@ aiowatttime==0.1.1
aiowebdav2==0.4.6 aiowebdav2==0.4.6
# homeassistant.components.webostv # homeassistant.components.webostv
aiowebostv==0.7.3 aiowebostv==0.7.4
# homeassistant.components.withings # homeassistant.components.withings
aiowithings==3.1.6 aiowithings==3.1.6

View File

@ -417,7 +417,7 @@ aiowatttime==0.1.1
aiowebdav2==0.4.6 aiowebdav2==0.4.6
# homeassistant.components.webostv # homeassistant.components.webostv
aiowebostv==0.7.3 aiowebostv==0.7.4
# homeassistant.components.withings # homeassistant.components.withings
aiowithings==3.1.6 aiowithings==3.1.6

View File

@ -4,7 +4,12 @@ from aiowebostv import WebOsTvPairError
import pytest import pytest
from homeassistant import config_entries from homeassistant import config_entries
from homeassistant.components.webostv.const import CONF_SOURCES, DOMAIN, LIVE_TV_APP_ID from homeassistant.components.webostv.const import (
CONF_SOURCES,
DEFAULT_NAME,
DOMAIN,
LIVE_TV_APP_ID,
)
from homeassistant.config_entries import SOURCE_SSDP from homeassistant.config_entries import SOURCE_SSDP
from homeassistant.const import CONF_CLIENT_SECRET, CONF_HOST, CONF_SOURCE from homeassistant.const import CONF_CLIENT_SECRET, CONF_HOST, CONF_SOURCE
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
@ -63,6 +68,29 @@ async def test_form(hass: HomeAssistant, client) -> None:
assert config_entry.unique_id == FAKE_UUID assert config_entry.unique_id == FAKE_UUID
async def test_form_no_model_name(hass: HomeAssistant, client) -> None:
"""Test successful user flow without model name."""
client.tv_info.system = {}
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={CONF_SOURCE: config_entries.SOURCE_USER},
data=MOCK_USER_CONFIG,
)
await hass.async_block_till_done()
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "pairing"
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input={}
)
assert result["type"] is FlowResultType.CREATE_ENTRY
assert result["title"] == DEFAULT_NAME
config_entry = result["result"]
assert config_entry.unique_id == FAKE_UUID
@pytest.mark.parametrize( @pytest.mark.parametrize(
("apps", "inputs"), ("apps", "inputs"),
[ [