fix announcement (#9155)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
parent
7130886d22
commit
9211248f96
@ -584,7 +584,7 @@ Expert:
|
|||||||
You can use a json formatted string to control title, sound and volume:
|
You can use a json formatted string to control title, sound and volume:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
{ "sound": true, "speak":"<Speak>" "title": "<Title>", "body": "<Body Text>", "volume": 20}
|
{ "sound": true, "speak":"<Speak>", "title": "<Title>", "body": "<Body Text>", "volume": 20}
|
||||||
```
|
```
|
||||||
|
|
||||||
The combination of `sound=true` and `speak` in SSML syntax is not allowed.
|
The combination of `sound=true` and `speak` in SSML syntax is not allowed.
|
||||||
|
|||||||
@ -1355,8 +1355,7 @@ public class Connection {
|
|||||||
JsonAnnouncementContent[] contentArray = new JsonAnnouncementContent[1];
|
JsonAnnouncementContent[] contentArray = new JsonAnnouncementContent[1];
|
||||||
JsonAnnouncementContent content = new JsonAnnouncementContent();
|
JsonAnnouncementContent content = new JsonAnnouncementContent();
|
||||||
content.display.title = title == null || title.isEmpty() ? "openHAB" : title;
|
content.display.title = title == null || title.isEmpty() ? "openHAB" : title;
|
||||||
content.display.body = bodyText;
|
content.display.body = bodyText.replaceAll("<.+?>", " ").replaceAll("\\s+", " ").trim();
|
||||||
content.display.body = speak.replaceAll("<.+?>", " ").replaceAll("\\s+", " ").trim();
|
|
||||||
if (speak.startsWith("<speak>") && speak.endsWith("</speak>")) {
|
if (speak.startsWith("<speak>") && speak.endsWith("</speak>")) {
|
||||||
content.speak.type = "ssml";
|
content.speak.type = "ssml";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user