From b177b638df73c8b59fd37e17ff9fe7b2add8091b Mon Sep 17 00:00:00 2001 From: Luca Mannella Date: Mon, 24 Jan 2022 14:20:21 +0100 Subject: [PATCH] `manifest.json` required to load the service (#1134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Joakim Sørensen Co-authored-by: Franck Nijhof --- docs/dev_101_services.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/dev_101_services.md b/docs/dev_101_services.md index 6beacc26..40672df1 100644 --- a/docs/dev_101_services.md +++ b/docs/dev_101_services.md @@ -31,13 +31,25 @@ def setup(hass, config): return True ``` -Load the integration by adding the following to your `configuration.yaml`. When your component is loaded, a new service should be available to call. +To load the integration in Home Assistant is necessary to create a `manifest.json` and to add an entry in your `configuration.yaml`. When your component is loaded, a new service should be available to call. ```yaml # configuration.yaml entry hello_service: ``` +An example of `manifest.json`: + +```json +{ + "domain": "hello_service", + "name": "Hello Service", + "documentation": "https://developers.home-assistant.io/docs/dev_101_services", + "iot_class": "local_push", + "version": "0.1.0" +} +``` + Open the frontend and in the sidebar, click the first icon in the developer tool section. This will open the Call Service developer tool. On the right, find your service and click on it. This will automatically fill in the correct values. Pressing "Call Service" will now call your service without any parameters. This will cause your service to create a state with the default name 'World'. If you want to specify the name, you have to specify a parameter by providing it through Service Data. In YAML mode, add the following and press "Call Service again".