Migrate LaMetric services to support translations (#96415)

This commit is contained in:
Franck Nijhof 2023-07-12 15:14:10 +02:00 committed by GitHub
parent c3871cc5ae
commit cccf436326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 191 additions and 137 deletions

View File

@ -1,129 +1,70 @@
chart: chart:
name: Display a chart
description: Display a chart on a LaMetric device.
fields: fields:
device_id: &device_id device_id: &device_id
name: Device
description: The LaMetric device to display the chart on.
required: true required: true
selector: selector:
device: device:
integration: lametric integration: lametric
data: data:
name: Data
description: The list of data points in the chart
required: true required: true
example: "[1,2,3,4,5,4,3,2,1]" example: "[1,2,3,4,5,4,3,2,1]"
selector: selector:
object: object:
sound: &sound sound: &sound
name: Sound
description: The notification sound to play.
required: false required: false
selector: selector:
select: select:
options: options:
- label: "Alarm 1" - "alarm1"
value: "alarm1" - "alarm2"
- label: "Alarm 2" - "alarm3"
value: "alarm2" - "alarm4"
- label: "Alarm 3" - "alarm5"
value: "alarm3" - "alarm6"
- label: "Alarm 4" - "alarm7"
value: "alarm4" - "alarm8"
- label: "Alarm 5" - "alarm9"
value: "alarm5" - "alarm10"
- label: "Alarm 6" - "alarm11"
value: "alarm6" - "alarm12"
- label: "Alarm 7" - "alarm13"
value: "alarm7" - "bicycle"
- label: "Alarm 8" - "car"
value: "alarm8" - "cash"
- label: "Alarm 9" - "cat"
value: "alarm9" - "dog"
- label: "Alarm 10" - "dog2"
value: "alarm10" - "energy"
- label: "Alarm 11" - "knock-knock"
value: "alarm11" - "letter_email"
- label: "Alarm 12" - "lose1"
value: "alarm12" - "lose2"
- label: "Alarm 13" - "negative1"
value: "alarm13" - "negative2"
- label: "Bicycle" - "negative3"
value: "bicycle" - "negative4"
- label: "Car" - "negative5"
value: "car" - "notification"
- label: "Cash" - "notification2"
value: "cash" - "notification3"
- label: "Cat" - "notification4"
value: "cat" - "open_door"
- label: "Dog 1" - "positive1"
value: "dog" - "positive2"
- label: "Dog 2" - "positive3"
value: "dog2" - "positive4"
- label: "Energy" - "positive5"
value: "energy" - "positive6"
- label: "Knock knock" - "statistic"
value: "knock-knock" - "thunder"
- label: "Letter email" - "water1"
value: "letter_email" - "water2"
- label: "Lose 1" - "win"
value: "lose1" - "win2"
- label: "Lose 2" - "wind"
value: "lose2" - "wind_short"
- label: "Negative 1" translation_key: sound
value: "negative1"
- label: "Negative 2"
value: "negative2"
- label: "Negative 3"
value: "negative3"
- label: "Negative 4"
value: "negative4"
- label: "Negative 5"
value: "negative5"
- label: "Notification 1"
value: "notification"
- label: "Notification 2"
value: "notification2"
- label: "Notification 3"
value: "notification3"
- label: "Notification 4"
value: "notification4"
- label: "Open door"
value: "open_door"
- label: "Positive 1"
value: "positive1"
- label: "Positive 2"
value: "positive2"
- label: "Positive 3"
value: "positive3"
- label: "Positive 4"
value: "positive4"
- label: "Positive 5"
value: "positive5"
- label: "Positive 6"
value: "positive6"
- label: "Statistic"
value: "statistic"
- label: "Thunder"
value: "thunder"
- label: "Water 1"
value: "water1"
- label: "Water 2"
value: "water2"
- label: "Win 1"
value: "win"
- label: "Win 2"
value: "win2"
- label: "Wind"
value: "wind"
- label: "Wind short"
value: "wind_short"
cycles: &cycles cycles: &cycles
name: Cycles
description: >-
The number of times to display the message. When set to 0, the message
will be displayed until dismissed.
required: false required: false
default: 1 default: 1
selector: selector:
@ -132,56 +73,35 @@ chart:
max: 10 max: 10
mode: slider mode: slider
icon_type: &icon_type icon_type: &icon_type
name: Icon type
description: >-
The type of icon to display, indicating the nature of the notification.
required: false required: false
default: "none" default: "none"
selector: selector:
select: select:
mode: dropdown mode: dropdown
options: options:
- label: "None" - "none"
value: "none" - "info"
- label: "Info" - "alert"
value: "info" translation_key: icon_type
- label: "Alert"
value: "alert"
priority: &priority priority: &priority
name: Priority
description: >-
The priority of the notification. When the device is running in
screensaver or kiosk mode, only critical priority notifications
will be accepted.
required: false required: false
default: "info" default: "info"
selector: selector:
select: select:
mode: dropdown mode: dropdown
options: options:
- label: "Info" - "info"
value: "info" - "warning"
- label: "Warning" - "critical"
value: "warning" translation_key: priority
- label: "Critical"
value: "critical"
message: message:
name: Display a message
description: Display a message with an optional icon on a LaMetric device.
fields: fields:
device_id: *device_id device_id: *device_id
message: message:
name: Message
description: The message to display.
required: true required: true
selector: selector:
text: text:
icon: icon:
name: Icon
description: >-
The ID number of the icon or animation to display. List of all icons
and their IDs can be found at: https://developer.lametric.com/icons
required: false required: false
selector: selector:
text: text:

View File

@ -78,5 +78,139 @@
"name": "Bluetooth" "name": "Bluetooth"
} }
} }
},
"services": {
"chart": {
"name": "Display a chart",
"description": "Displays a chart on a LaMetric device.",
"fields": {
"device_id": {
"name": "Device",
"description": "The LaMetric device to display the chart on."
},
"data": {
"name": "Data",
"description": "The list of data points in the chart."
},
"sound": {
"name": "Sound",
"description": "The notification sound to play."
},
"cycles": {
"name": "Cycles",
"description": "The number of times to display the message. When set to 0, the message will be displayed until dismissed."
},
"icon_type": {
"name": "Icon type",
"description": "The type of icon to display, indicating the nature of the notification."
},
"priority": {
"name": "Priority",
"description": "The priority of the notification. When the device is running in screensaver or kiosk mode, only critical priority notifications will be accepted."
}
}
},
"message": {
"name": "Display a message",
"description": "Displays a message with an optional icon on a LaMetric device.",
"fields": {
"device_id": {
"name": "[%key:component::lametric::services::chart::fields::device_id::name%]",
"description": "The LaMetric device to display the message on."
},
"message": {
"name": "Message",
"description": "The message to display."
},
"icon": {
"name": "Icon",
"description": "The ID number of the icon or animation to display. List of all icons and their IDs can be found at: https://developer.lametric.com/icons."
},
"sound": {
"name": "[%key:component::lametric::services::chart::fields::sound::name%]",
"description": "[%key:component::lametric::services::chart::fields::sound::description%]"
},
"cycles": {
"name": "[%key:component::lametric::services::chart::fields::cycles::name%]",
"description": "[%key:component::lametric::services::chart::fields::cycles::description%]"
},
"icon_type": {
"name": "[%key:component::lametric::services::chart::fields::icon_type::name%]",
"description": "[%key:component::lametric::services::chart::fields::icon_type::description%]"
},
"priority": {
"name": "[%key:component::lametric::services::chart::fields::priority::name%]",
"description": "[%key:component::lametric::services::chart::fields::priority::description%]"
}
}
}
},
"selector": {
"sound": {
"options": {
"alarm1": "Alarm 1",
"alarm2": "Alarm 2",
"alarm3": "Alarm 3",
"alarm4": "Alarm 4",
"alarm5": "Alarm 5",
"alarm6": "Alarm 6",
"alarm7": "Alarm 7",
"alarm8": "Alarm 8",
"alarm9": "Alarm 9",
"alarm10": "Alarm 10",
"alarm11": "Alarm 11",
"alarm12": "Alarm 12",
"alarm13": "Alarm 13",
"bicycle": "Bicycle",
"car": "Car",
"cash": "Cash",
"cat": "Cat",
"dog": "Dog 1",
"dog2": "Dog 2",
"energy": "Energy",
"knock-knock": "Knock knock",
"letter_email": "Letter email",
"lose1": "Lose 1",
"lose2": "Lose 2",
"negative1": "Negative 1",
"negative2": "Negative 2",
"negative3": "Negative 3",
"negative4": "Negative 4",
"negative5": "Negative 5",
"notification": "Notification 1",
"notification2": "Notification 2",
"notification3": "Notification 3",
"notification4": "Notification 4",
"open_door": "Open door",
"positive1": "Positive 1",
"positive2": "Positive 2",
"positive3": "Positive 3",
"positive4": "Positive 4",
"positive5": "Positive 5",
"positive6": "Positive 6",
"statistic": "Statistic",
"thunder": "Thunder",
"water1": "Water 1",
"water2": "Water 2",
"win": "Win 1",
"win2": "Win 2",
"wind": "Wind",
"wind_short": "Wind short"
}
},
"icon_type": {
"options": {
"none": "None",
"info": "Info",
"alert": "Alert"
}
},
"priority": {
"options": {
"info": "Info",
"warning": "Warning",
"critical": "Critical"
}
}
} }
} }