Set single_config_entry in cpuspeed (#131486)

* Set single_config_entry in cpuspeed

* Adjust tests
This commit is contained in:
epenet 2024-11-24 23:55:03 +01:00 committed by GitHub
parent 428d7d1ad8
commit 9f8a656eff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,6 @@ class CPUSpeedFlowHandler(ConfigFlow, domain=DOMAIN):
) -> ConfigFlowResult:
"""Handle a flow initialized by the user."""
await self.async_set_unique_id(DOMAIN)
self._abort_if_unique_id_configured()
if user_input is None:
return self.async_show_form(step_id="user")

View File

@ -6,5 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/cpuspeed",
"integration_type": "device",
"iot_class": "local_push",
"requirements": ["py-cpuinfo==9.0.0"]
"requirements": ["py-cpuinfo==9.0.0"],
"single_config_entry": true
}

View File

@ -8,7 +8,6 @@
}
},
"abort": {
"already_configured": "[%key:common::config_flow::abort::single_instance_allowed%]",
"not_compatible": "Unable to get CPU information, this integration is not compatible with your system"
}
}

View File

@ -1057,7 +1057,8 @@
"cpuspeed": {
"integration_type": "device",
"config_flow": true,
"iot_class": "local_push"
"iot_class": "local_push",
"single_config_entry": true
},
"cribl": {
"name": "Cribl",

View File

@ -50,7 +50,7 @@ async def test_already_configured(
)
assert result.get("type") is FlowResultType.ABORT
assert result.get("reason") == "already_configured"
assert result.get("reason") == "single_instance_allowed"
assert len(mock_setup_entry.mock_calls) == 0
assert len(mock_cpuinfo_config_flow.mock_calls) == 0