From 7ff1759487201020807b4a69a6a93affa7001535 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 28 Sep 2018 01:15:03 +0200 Subject: [PATCH] Add additional section (#96) --- docs/creating_component_code_review.md | 8 +++++++- docs/creating_platform_code_review.md | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/creating_component_code_review.md b/docs/creating_component_code_review.md index e94d35cc..5a173d7a 100644 --- a/docs/creating_component_code_review.md +++ b/docs/creating_component_code_review.md @@ -6,6 +6,12 @@ A checklist of things to do when you're adding a new component. > Not all existing platforms follow the requirements in this checklist. This cannot be used as a reason to not follow them! +### 0. Common + + 1. Follow our [Style guidelines](development_guidelines.md) + 2. Use existing constants from [`const.py`](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/const.py) + * Only add new constants to `const.py` if they are widely used. Otherwise keep them on components level + ### 1. Requirements 1. Requirement version pinned: `REQUIREMENTS = ['phue==0.8.1']` @@ -14,7 +20,7 @@ A checklist of things to do when you're adding a new component. ### 2. Configuration - 1. Voluptuous schema present for config validation + 1. Voluptuous schema present for [configuration validation](development_validation.md) 2. Default parameters specified in voluptuous schema, not in `setup(…)` 3. Schema using as many generic config keys as possible from `homeassistant.const` 4. If your component has platforms, define a `PLATFORM_SCHEMA` instead of a `CONFIG_SCHEMA`. diff --git a/docs/creating_platform_code_review.md b/docs/creating_platform_code_review.md index e230b7af..54a781a2 100644 --- a/docs/creating_platform_code_review.md +++ b/docs/creating_platform_code_review.md @@ -6,6 +6,13 @@ A checklist of things to do when you're adding a new platform. > Not all existing platforms follow the requirements in this checklist. This cannot be used as a reason to not follow them! +### 0. Common + + 1. Follow our [Style guidelines](development_guidelines.md) + 2. Use existing constants from [`const.py`](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/const.py) + * Only add new constants to `const.py` if they are widely used. Otherwise keep them on platform level + * Use `CONF_MONITORED_CONDITIONS` instead of `CONF_MONITORED_VARIABLES` + ### 1. Requirements 1. Requirement version should be pinned: `REQUIREMENTS = ['phue==0.8.1']` @@ -18,7 +25,7 @@ A checklist of things to do when you're adding a new platform. ### 3. Configuration - 1. Voluptuous schema present for config validation + 1. Voluptuous schema present for [configuration validation](development_validation.md) 2. Voluptuous schema extends schema from component
(e.g., `light.hue.PLATFORM_SCHEMA` extends `light.PLATFORM_SCHEMA`) 3. Default parameters specified in voluptuous schema, not in `setup_platform(...)` 4. Your `PLATFORM_SCHEMA` should use as many generic config keys as possible from `homeassistant.const`