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.lifx.internal;
15 import static org.openhab.binding.lifx.internal.LifxBindingConstants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.core.library.CoreItemFactory;
19 import org.openhab.core.thing.Channel;
20 import org.openhab.core.thing.ChannelUID;
21 import org.openhab.core.thing.DefaultSystemChannelTypeProvider;
22 import org.openhab.core.thing.ThingUID;
23 import org.openhab.core.thing.binding.builder.ChannelBuilder;
24 import org.osgi.service.component.annotations.Component;
27 * The {@link LifxChannelFactoryImpl} creates dynamic LIFX channels.
29 * @author Wouter Born - Initial contribution
32 @Component(service = LifxChannelFactory.class)
33 public class LifxChannelFactoryImpl implements LifxChannelFactory {
36 public Channel createAbsTemperatureZoneChannel(ThingUID thingUID, int index) {
38 .create(new ChannelUID(thingUID, CHANNEL_ABS_TEMPERATURE_ZONE + index), CoreItemFactory.NUMBER)
39 .withType(DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_TYPE_UID_COLOR_TEMPERATURE_ABS).build();
43 public Channel createColorZoneChannel(ThingUID thingUID, int index) {
44 return ChannelBuilder.create(new ChannelUID(thingUID, CHANNEL_COLOR_ZONE + index), CoreItemFactory.COLOR)
45 .withType(DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_TYPE_UID_COLOR).build();
49 public Channel createTemperatureZoneChannel(ThingUID thingUID, int index) {
50 return ChannelBuilder.create(new ChannelUID(thingUID, CHANNEL_TEMPERATURE_ZONE + index), CoreItemFactory.DIMMER)
51 .withType(DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_TYPE_UID_COLOR_TEMPERATURE).build();