]> git.basschouten.com Git - openhab-addons.git/blob
561a0cc237b98d529691093081c009551883da2c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.binding.miio.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ThingStatus;
17 import org.openhab.core.thing.ThingStatusDetail;
18
19 /**
20  * Interface for a listener on the {@link org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication}.
21  * Informs when a message is received.
22  *
23  * @author Marcel Verpaalen - Initial contribution
24  */
25 @NonNullByDefault
26 public interface MiIoMessageListener {
27     /**
28      * Callback method for the {@link MiIoMessageListener}
29      *
30      * @param cmd The received message in JSON format
31      */
32     void onMessageReceived(MiIoSendCommand cmd);
33
34     /**
35      * Callback method for the {@link MiIoMessageListener}
36      *
37      * @param status Status online/offline
38      * @param statusDetail Status details text
39      */
40     void onStatusUpdated(ThingStatus status, ThingStatusDetail statusDetail);
41 }