mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	[core] os.path -> Path (#10654)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
		| @@ -40,9 +40,9 @@ def config_path(request: pytest.FixtureRequest) -> Generator[None]: | ||||
|     if config_dir.exists(): | ||||
|         # Set config_path to a dummy yaml file in the config directory | ||||
|         # This ensures CORE.config_dir points to the config directory | ||||
|         CORE.config_path = str(config_dir / "dummy.yaml") | ||||
|         CORE.config_path = config_dir / "dummy.yaml" | ||||
|     else: | ||||
|         CORE.config_path = str(Path(request.fspath).parent / "dummy.yaml") | ||||
|         CORE.config_path = Path(request.fspath).parent / "dummy.yaml" | ||||
|  | ||||
|     yield | ||||
|     CORE.config_path = original_path | ||||
| @@ -129,7 +129,7 @@ def generate_main() -> Generator[Callable[[str | Path], str]]: | ||||
|     """Generates the C++ main.cpp from a given yaml file and returns it in string form.""" | ||||
|  | ||||
|     def generator(path: str | Path) -> str: | ||||
|         CORE.config_path = str(path) | ||||
|         CORE.config_path = Path(path) | ||||
|         CORE.config = read_config({}) | ||||
|         generate_cpp_contents(CORE.config) | ||||
|         return CORE.cpp_main_section | ||||
|   | ||||
		Reference in New Issue
	
	Block a user