mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Audiosink might be null (#2224)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
+4
-2
@@ -44,7 +44,7 @@ public class PlayActionHandler extends BaseActionModuleHandler {
|
||||
private final AudioManager audioManager;
|
||||
|
||||
private final String sound;
|
||||
private final String sink;
|
||||
private final @Nullable String sink;
|
||||
private final @Nullable PercentType volume;
|
||||
|
||||
public PlayActionHandler(Action module, AudioManager audioManager) {
|
||||
@@ -52,7 +52,9 @@ public class PlayActionHandler extends BaseActionModuleHandler {
|
||||
this.audioManager = audioManager;
|
||||
|
||||
this.sound = module.getConfiguration().get(PARAM_SOUND).toString();
|
||||
this.sink = module.getConfiguration().get(PARAM_SINK).toString();
|
||||
|
||||
Object sinkParam = module.getConfiguration().get(PARAM_SINK);
|
||||
this.sink = sinkParam != null ? sinkParam.toString() : null;
|
||||
|
||||
Object volumeParam = module.getConfiguration().get(PARAM_VOLUME);
|
||||
this.volume = volumeParam instanceof BigDecimal ? new PercentType((BigDecimal) volumeParam) : null;
|
||||
|
||||
+5
-3
@@ -39,15 +39,17 @@ public class SayActionHandler extends BaseActionModuleHandler {
|
||||
private final VoiceManager voiceManager;
|
||||
|
||||
private final String text;
|
||||
private final String sink;
|
||||
private final @Nullable String sink;
|
||||
private final @Nullable PercentType volume;
|
||||
|
||||
public SayActionHandler(Action module, VoiceManager voiceManager) {
|
||||
super(module);
|
||||
this.voiceManager = voiceManager;
|
||||
|
||||
text = module.getConfiguration().get(PARAM_TEXT).toString();
|
||||
sink = module.getConfiguration().get(PARAM_SINK).toString();
|
||||
this.text = module.getConfiguration().get(PARAM_TEXT).toString();
|
||||
|
||||
Object sinkParam = module.getConfiguration().get(PARAM_SINK);
|
||||
this.sink = sinkParam != null ? sinkParam.toString() : null;
|
||||
|
||||
Object volumeParam = module.getConfiguration().get(PARAM_VOLUME);
|
||||
this.volume = volumeParam instanceof BigDecimal ? new PercentType((BigDecimal) volumeParam) : null;
|
||||
|
||||
Reference in New Issue
Block a user