Skip to content

Commit 28405e2

Browse files
authored
Add model name to Lunatone devices (home-assistant#154432)
1 parent 31857a0 commit 28405e2

File tree

7 files changed

+9
-5
lines changed

7 files changed

+9
-5
lines changed

homeassistant/components/lunatone/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: LunatoneConfigEntry) ->
4545
hw_version=info_api.data.device.pcb,
4646
configuration_url=entry.data[CONF_URL],
4747
serial_number=str(info_api.serial_number),
48+
model=info_api.product_name,
4849
model_id=(
4950
f"{info_api.data.device.article_number}{info_api.data.device.article_info}"
5051
),

homeassistant/components/lunatone/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"integration_type": "hub",
88
"iot_class": "local_polling",
99
"quality_scale": "silver",
10-
"requirements": ["lunatone-rest-api-client==0.4.8"]
10+
"requirements": ["lunatone-rest-api-client==0.5.3"]
1111
}

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/lunatone/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from tests.common import MockConfigEntry
1818

1919
BASE_URL: Final = "http://10.0.0.131"
20+
PRODUCT_NAME: Final = "Test Product"
2021
SERIAL_NUMBER: Final = 12345
2122
VERSION: Final = "v1.14.1/1.4.3"
2223

tests/components/lunatone/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from homeassistant.components.lunatone.const import DOMAIN
1010
from homeassistant.const import CONF_URL
1111

12-
from . import BASE_URL, DEVICES_DATA, INFO_DATA, SERIAL_NUMBER
12+
from . import BASE_URL, DEVICES_DATA, INFO_DATA, PRODUCT_NAME, SERIAL_NUMBER
1313

1414
from tests.common import MockConfigEntry
1515

@@ -68,6 +68,7 @@ def mock_lunatone_info() -> Generator[AsyncMock]:
6868
info.name = info.data.name
6969
info.version = info.data.version
7070
info.serial_number = info.data.device.serial
71+
info.product_name = PRODUCT_NAME
7172
yield info
7273

7374

tests/components/lunatone/test_init.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from homeassistant.core import HomeAssistant
1010
from homeassistant.helpers import device_registry as dr
1111

12-
from . import BASE_URL, VERSION, setup_integration
12+
from . import BASE_URL, PRODUCT_NAME, VERSION, setup_integration
1313

1414
from tests.common import MockConfigEntry
1515

@@ -33,6 +33,7 @@ async def test_load_unload_config_entry(
3333
assert device_entry.manufacturer == "Lunatone"
3434
assert device_entry.sw_version == VERSION
3535
assert device_entry.configuration_url == BASE_URL
36+
assert device_entry.model == PRODUCT_NAME
3637

3738
await hass.config_entries.async_unload(mock_config_entry.entry_id)
3839
await hass.async_block_till_done()

0 commit comments

Comments
 (0)