]> git.basschouten.com Git - openhab-addons.git/blob
84abfe35ab40fe601d34c8305acc9e8f748bcb1e
[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.avmfritz.internal.handler;
14
15 import static org.openhab.binding.avmfritz.internal.AVMFritzBindingConstants.*;
16
17 import java.util.Map;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.binding.avmfritz.internal.dto.AVMFritzBaseModel;
21 import org.openhab.binding.avmfritz.internal.dto.GroupModel;
22 import org.openhab.core.thing.Thing;
23
24 /**
25  * Handler for a FRITZ! group. Handles commands, which are sent to one of the channels.
26  *
27  * @author Christoph Weitkamp - Initial contribution
28  */
29 @NonNullByDefault
30 public class GroupHandler extends AVMFritzBaseThingHandler {
31
32     public GroupHandler(Thing thing) {
33         super(thing);
34     }
35
36     @Override
37     protected void updateProperties(AVMFritzBaseModel device, Map<String, String> editProperties) {
38         if (device instanceof GroupModel groupModel) {
39             if (groupModel.getGroupinfo() != null) {
40                 editProperties.put(PROPERTY_MASTER, groupModel.getGroupinfo().getMasterdeviceid());
41                 editProperties.put(PROPERTY_MEMBERS, groupModel.getGroupinfo().getMembers());
42             }
43         }
44         super.updateProperties(device, editProperties);
45     }
46 }