├── hacs.json ├── custom_components └── mostly_default_config │ ├── const.py │ ├── manifest.json │ └── __init__.py └── README.md /hacs.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Mostly Default Config", 3 | "render_readme": true, 4 | "iot_class": "assumed_state" 5 | } 6 | -------------------------------------------------------------------------------- /custom_components/mostly_default_config/const.py: -------------------------------------------------------------------------------- 1 | DEFAULT_CONFIG = "default_config" 2 | DEPENDENCIES = "dependencies" 3 | DOMAIN = "mostly_default_config" 4 | EXCLUDE = "exclude" -------------------------------------------------------------------------------- /custom_components/mostly_default_config/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain": "mostly_default_config", 3 | "name": "Mostly Default Config", 4 | "config_flow": false, 5 | "codeowners": ["@abjugard"], 6 | "dependencies": ["recorder"], 7 | "requirements": [], 8 | "documentation": "https://github.com/abjugard/homeassistant-mostly_default_config", 9 | "issue_tracker": "https://github.com/abjugard/homeassistant-mostly_default_config/issues", 10 | "iot_class": "assumed_state", 11 | "version": "1.1" 12 | } -------------------------------------------------------------------------------- /custom_components/mostly_default_config/__init__.py: -------------------------------------------------------------------------------- 1 | """Component providing mostly default configuration for somewhat new users.""" 2 | from .const import * 3 | 4 | import asyncio 5 | 6 | from homeassistant import core 7 | from homeassistant.loader import async_get_integration 8 | from homeassistant.setup import async_setup_component 9 | 10 | 11 | async def async_setup(hass: core.HomeAssistant, config: dict) -> bool: 12 | conf = config.get(DOMAIN) 13 | exclude = set(conf.get(EXCLUDE, [])) 14 | 15 | default_component = await async_get_integration(hass, DEFAULT_CONFIG) 16 | default_dependencies = set(default_component.manifest[DEPENDENCIES]) 17 | 18 | await asyncio.gather( 19 | *( 20 | async_setup_component(hass, domain, config) 21 | for domain in default_dependencies - exclude 22 | ) 23 | ) 24 | 25 | return True 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mostly Default Config for Home Assistant 2 | 3 | Implements a mostly default config for those who wish for their configuration to follow the default configuration, but excluding specific component(s). 4 | 5 | ## Installation 6 | 7 | 1. Install this custom component (it is recommended to add this as a [custom repository in HACS](https://hacs.xyz/docs/faq/custom_repositories/)) 8 | 2. Remove `default_config` from `configuration.yaml` and replace it with something like: 9 | ``` 10 | mostly_default_config: 11 | exclude: 12 | - map 13 | - logbook 14 | - ... 15 | ``` 16 | 3. Restart Home Assistant 17 | 4. Enjoy a default config without the specific component(s) you wanted to disable 18 | 19 | See [here](https://github.com/home-assistant/core/blob/master/homeassistant/components/default_config/manifest.json) for a current list of components that are loaded by `default_config` and can be individually excluded by this component. 20 | 21 | ## Limitations 22 | 23 | Current implementation will always load `recorder` since that particular component requires special setup. --------------------------------------------------------------------------------