def get_integration(self, integration: Union[str, dict]) -> Integration: parsed_integration = self.parse_integration(integration) kwargs = {k: v for k, v in parsed_integration.items() if k != "name"} integrations = integration_module.get_integrations(self, kwargs) integration_argument = self.get_option(parsed_integration["name"], [i.name for i in integrations]) return next(i for i in integrations if i.name == integration_argument)
def test_get_integrations(fake_controller: Controller): integrations = integration_module.get_integrations(fake_controller, {}) inteagration_names = {i.name for i in integrations} assert inteagration_names == {"z2m", "zha", "deconz", "state", "mqtt"}