]> git.basschouten.com Git - openhab-addons.git/blob
4b93b0bf66d115105ed6f253b9222deb2147b2b8
[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.solaredge.internal.handler;
14
15 import java.util.List;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.eclipse.jetty.client.HttpClient;
20 import org.openhab.core.thing.Channel;
21 import org.openhab.core.thing.ChannelGroupUID;
22 import org.openhab.core.thing.ChannelUID;
23 import org.openhab.core.thing.Thing;
24 import org.openhab.core.thing.ThingUID;
25
26 /**
27  * generic thing handler for solaredge
28  *
29  * @author Alexander Friese - initial contribution
30  */
31 @NonNullByDefault
32 public class GenericSolarEdgeHandler extends SolarEdgeBaseHandler {
33
34     public GenericSolarEdgeHandler(Thing thing, HttpClient httpClient) {
35         super(thing, httpClient);
36     }
37
38     @Override
39     public List<Channel> getChannels() {
40         return getThing().getChannels();
41     }
42
43     @Override
44     public @Nullable Channel getChannel(String groupId, String channelId) {
45         ThingUID thingUID = this.getThing().getUID();
46         ChannelGroupUID channelGroupUID = new ChannelGroupUID(thingUID, groupId);
47         Channel channel = getThing().getChannel(new ChannelUID(channelGroupUID, channelId));
48         return channel;
49     }
50 }