]> git.basschouten.com Git - openhab-addons.git/blob
8aa53dfddae72e881b456b37a8b638577be0b215
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.io.openhabcloud.internal.actions;
14
15 import java.util.Map;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.core.automation.Action;
20 import org.openhab.core.automation.handler.ModuleHandler;
21 import org.openhab.io.openhabcloud.internal.CloudService;
22
23 /**
24  * This is a {@link ModuleHandler} implementation for {@link Action}s to send a notification to all devices of all
25  * cloud users.
26  *
27  * @author Christoph Weitkamp - Initial contribution
28  */
29 @NonNullByDefault
30 public class SendBroadcastNotificationActionHandler extends BaseNotificationActionHandler {
31
32     public static final String TYPE_ID = "notification.SendBroadcastNotification";
33     public static final String EXTENDED_TYPE_ID = "notification.SendExtendedBroadcastNotification";
34
35     public SendBroadcastNotificationActionHandler(Action module, CloudService cloudService) {
36         super(module, cloudService);
37     }
38
39     @Override
40     public @Nullable Map<String, Object> execute(Map<String, Object> context) {
41         cloudService.sendBroadcastNotification(message, icon, severity);
42         return null;
43     }
44 }