1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-02 08:26:41 +01:00

Use hass.config.config_dir

This commit is contained in:
epenet
2026-03-31 10:09:35 +00:00
parent 3f74cca253
commit aa4cadf9cd

View File

@@ -3,6 +3,7 @@
from __future__ import annotations
import logging
from pathlib import Path
from typing import Any, NamedTuple
from tuya_device_handlers.devices import register_tuya_quirks
@@ -108,7 +109,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: TuyaConfigEntry) -> bool
model_id=device.product_id,
)
await hass.async_add_executor_job(register_tuya_quirks, "/config/tuya_quirks/")
await hass.async_add_executor_job(
register_tuya_quirks, str(Path(hass.config.config_dir, "tuya_quirks"))
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
# If the device does not register any entities, the device does not need to subscribe
# So the subscription is here