Ensure rainmachine creates config entry titles as strings (#70417)
This commit is contained in:
parent
edffac82e9
commit
cc3d6aa247
4 changed files with 7 additions and 5 deletions
|
@ -132,7 +132,7 @@ class RainMachineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
# access token without using the IP address and password, so we have to
|
||||
# store it:
|
||||
return self.async_create_entry(
|
||||
title=controller.name,
|
||||
title=str(controller.name),
|
||||
data={
|
||||
CONF_IP_ADDRESS: user_input[CONF_IP_ADDRESS],
|
||||
CONF_PASSWORD: user_input[CONF_PASSWORD],
|
||||
|
|
|
@ -49,7 +49,9 @@ def controller_fixture(
|
|||
controller = AsyncMock()
|
||||
controller.api_version = "4.5.0"
|
||||
controller.hardware_version = 3
|
||||
controller.name = "My RainMachine"
|
||||
# The api returns a controller with all numbers as numeric
|
||||
# instead of a string
|
||||
controller.name = 12345
|
||||
controller.mac = controller_mac
|
||||
controller.software_version = "4.0.925"
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ async def test_step_user(hass, config, setup_rainmachine):
|
|||
data=config,
|
||||
)
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result["title"] == "My RainMachine"
|
||||
assert result["title"] == "12345"
|
||||
assert result["data"] == {
|
||||
CONF_IP_ADDRESS: "192.168.1.100",
|
||||
CONF_PASSWORD: "password",
|
||||
|
@ -232,7 +232,7 @@ async def test_step_homekit_zeroconf_new_controller_when_some_exist(
|
|||
await hass.async_block_till_done()
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["title"] == "My RainMachine"
|
||||
assert result2["title"] == "12345"
|
||||
assert result2["data"] == {
|
||||
CONF_IP_ADDRESS: "192.168.1.100",
|
||||
CONF_PASSWORD: "password",
|
||||
|
|
|
@ -585,7 +585,7 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_rainmach
|
|||
"controller": {
|
||||
"api_version": "4.5.0",
|
||||
"hardware_version": 3,
|
||||
"name": "My RainMachine",
|
||||
"name": 12345,
|
||||
"software_version": "4.0.925",
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue