]> git.basschouten.com Git - openhab-addons.git/blob
7981babe910d60f34159e9842c3dbc6cfe24c766
[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.onewire.internal.device;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.onewire.internal.DigitalIoConfig;
17 import org.openhab.binding.onewire.internal.OwException;
18 import org.openhab.binding.onewire.internal.SensorId;
19 import org.openhab.binding.onewire.internal.handler.OwBaseThingHandler;
20 import org.openhab.binding.onewire.internal.owserver.OwserverDeviceParameter;
21
22 /**
23  * The {@link DS2406_DS2413} class defines a DS2406 or DS2413 device
24  *
25  * @author Jan N. Klug - Initial contribution
26  */
27 @NonNullByDefault
28 public class DS2406_DS2413 extends AbstractDigitalOwDevice {
29     public DS2406_DS2413(SensorId sensorId, OwBaseThingHandler callback) {
30         super(sensorId, callback);
31     }
32
33     @Override
34     public void configureChannels() throws OwException {
35         ioConfig.clear();
36         ioConfig.add(new DigitalIoConfig(callback.getThing(), 0, new OwserverDeviceParameter("uncached/", "/sensed.A"),
37                 new OwserverDeviceParameter("/PIO.A")));
38         ioConfig.add(new DigitalIoConfig(callback.getThing(), 1, new OwserverDeviceParameter("uncached/", "/sensed.B"),
39                 new OwserverDeviceParameter("/PIO.B")));
40
41         fullInParam = new OwserverDeviceParameter("uncached/", "/sensed.BYTE");
42         fullOutParam = new OwserverDeviceParameter("/PIO.BYTE");
43
44         super.configureChannels();
45     }
46 }