From 6b2ada7cc2d383f8931c79377886b324684353cd Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Jul 2023 10:17:18 +0200 Subject: [PATCH 1/2] Migrate notify services to support translations --- homeassistant/components/notify/services.yaml | 24 ---------- homeassistant/components/notify/strings.json | 46 ++++++++++++++++++- 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/homeassistant/components/notify/services.yaml b/homeassistant/components/notify/services.yaml index 9311acf2ba9536..8d053e3af5835f 100644 --- a/homeassistant/components/notify/services.yaml +++ b/homeassistant/components/notify/services.yaml @@ -1,61 +1,37 @@ # Describes the format for available notification services notify: - name: Send a notification - description: Sends a notification message to selected notify platforms. fields: message: - name: Message - description: Message body of the notification. required: true example: The garage door has been open for 10 minutes. selector: text: title: - name: Title - description: Title for your notification. example: "Your Garage Door Friend" selector: text: target: - name: Target - description: - An array of targets to send the notification to. Optional depending on - the platform. example: platform specific selector: object: data: - name: Data - description: - Extended information for notification. Optional depending on the - platform. example: platform specific selector: object: persistent_notification: - name: Send a persistent notification - description: Sends a notification that is visible in the front-end. fields: message: - name: Message - description: Message body of the notification. required: true example: The garage door has been open for 10 minutes. selector: text: title: - name: Title - description: Title for your notification. example: "Your Garage Door Friend" selector: text: data: - name: Data - description: - Extended information for notification. Optional depending on the - platform. example: platform specific selector: object: diff --git a/homeassistant/components/notify/strings.json b/homeassistant/components/notify/strings.json index 02027a84d8f4a4..5faefe7aa902ba 100644 --- a/homeassistant/components/notify/strings.json +++ b/homeassistant/components/notify/strings.json @@ -1 +1,45 @@ -{ "title": "Notifications" } +{ + "title": "Notifications", + "services": { + "notify": { + "name": "Sends a notification", + "description": "Sends a notification message to selected notify platforms.", + "fields": { + "message": { + "name": "Message", + "description": "Message body of the notification." + }, + "title": { + "name": "Title", + "description": "Title for your notification." + }, + "target": { + "name": "Target", + "description": "An array of targets to send the notification to. Optional depending on the platform." + }, + "data": { + "name": "Data", + "description": "Extended information for notification. Optional depending on the platform." + } + } + }, + "persistent_notification": { + "name": "Send a persistent notification", + "description": "Sends a notification that is visible in the front-end.", + "fields": { + "message": { + "name": "Message", + "description": "Message body of the notification." + }, + "title": { + "name": "Title", + "description": "Title for your notification." + }, + "data": { + "name": "Data", + "description": "Extended information for notification. Optional depending on the platform." + } + } + } + } +} From b55d77c3eaa6b60e4b2e35ea7aa94f95e7afce4d Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Jul 2023 19:18:19 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- homeassistant/components/notify/strings.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/notify/strings.json b/homeassistant/components/notify/strings.json index 5faefe7aa902ba..cff7b265c37d7b 100644 --- a/homeassistant/components/notify/strings.json +++ b/homeassistant/components/notify/strings.json @@ -2,8 +2,8 @@ "title": "Notifications", "services": { "notify": { - "name": "Sends a notification", - "description": "Sends a notification message to selected notify platforms.", + "name": "Send a notification", + "description": "Sends a notification message to selected targets.", "fields": { "message": { "name": "Message", @@ -15,17 +15,17 @@ }, "target": { "name": "Target", - "description": "An array of targets to send the notification to. Optional depending on the platform." + "description": "Some integrations allow you to specify the targets that receive the notification. For more information, refer to the integration documentation." }, "data": { "name": "Data", - "description": "Extended information for notification. Optional depending on the platform." + "description": "Some integrations provide extended functionality. For information on how to use _data_, refer to the integration documentation." } } }, "persistent_notification": { "name": "Send a persistent notification", - "description": "Sends a notification that is visible in the front-end.", + "description": "Sends a notification that is visible in the **Notifications** panel.", "fields": { "message": { "name": "Message", @@ -33,11 +33,11 @@ }, "title": { "name": "Title", - "description": "Title for your notification." + "description": "Title of the notification." }, "data": { "name": "Data", - "description": "Extended information for notification. Optional depending on the platform." + "description": "Some integrations provide extended functionality. For information on how to use _data_, refer to the integration documentation.." } } }