2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.homematic.test.util;
15 import org.openhab.binding.homematic.internal.model.HmChannel;
16 import org.openhab.binding.homematic.internal.model.HmDatapoint;
17 import org.openhab.binding.homematic.internal.model.HmDevice;
18 import org.openhab.core.thing.Thing;
19 import org.openhab.core.thing.ThingTypeUID;
20 import org.openhab.core.thing.ThingUID;
21 import org.openhab.core.thing.binding.builder.ThingBuilder;
24 * Class that contains static helper methods to create several kinds of objects
25 * (e.g. {@link ThingUID}, {@link HmDevice}, {@link HmDatapoint}) related to a
28 * @author Florian Stolte - Initial Contribution
31 public class DimmerHelper {
33 public static HmDevice createDimmerHmDevice() {
34 return createDimmerHmDevice("CCU2");
37 public static HmDevice createDimmerHmDevice(String gatewayType) {
38 HmDevice hmDevice = new HmDevice("ABC12345678", null, "HM-LC-Dim1-Pl3", gatewayType, "", "1");
39 hmDevice.setName("Homematic Dimmer");
43 public static HmChannel createDimmerHmChannel() {
44 HmChannel hmChannel = new HmChannel("HM-LC-Dim1-Pl3", 1);
45 hmChannel.setDevice(createDimmerHmDevice());
50 public static HmChannel createDimmerDummyChannel() {
51 HmChannel hmChannel = new HmChannel("HM-LC-Dim1-Pl3", -1);
52 hmChannel.setDevice(createDimmerHmDevice());
57 public static HmDatapoint createDimmerHmDatapoint() {
58 HmDatapoint hmDatapoint = new HmDatapoint();
59 hmDatapoint.setName("DIMMER");
60 hmDatapoint.setChannel(createDimmerHmChannel());
65 public static ThingTypeUID createDimmerThingTypeUID() {
66 return new ThingTypeUID("homematic:HM-LC-Dim1-Pl3");
69 public static ThingUID createDimmerThingUID() {
70 return new ThingUID(createDimmerThingTypeUID(), "ABC12345678");
73 public static Thing createDimmerThing() {
74 return ThingBuilder.create(createDimmerThingTypeUID(), createDimmerThingUID()).build();