]> git.basschouten.com Git - openhab-addons.git/blob
116ad5a681dce2b2836761b8705bf3dd452bbb23
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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.teleinfo.internal.handler.cbemm;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.teleinfo.internal.dto.Frame;
17 import org.openhab.binding.teleinfo.internal.dto.cbemm.FrameCbemmTempoOption;
18 import org.openhab.binding.teleinfo.internal.handler.TeleinfoAbstractControllerHandler;
19 import org.openhab.core.thing.Thing;
20
21 /**
22  * The {@link TeleinfoTempoCbemmElectricityMeterHandler} class defines a handler for a TEMPO CBEMM Electricity Meters
23  * thing.
24  *
25  * @author Nicolas SIBERIL - Initial contribution
26  * @author Olivier MARCEAU - Change ADCO property to parameter
27  */
28 @NonNullByDefault
29 public class TeleinfoTempoCbemmElectricityMeterHandler extends TeleinfoAbstractCbemmElectricityMeterHandler {
30
31     public TeleinfoTempoCbemmElectricityMeterHandler(Thing thing) {
32         super(thing);
33     }
34
35     @Override
36     public void onFrameReceived(TeleinfoAbstractControllerHandler controllerHandler, Frame frame) {
37         final FrameCbemmTempoOption frameCbemmTempoOption = (FrameCbemmTempoOption) frame;
38
39         String adco = configuration.getAdco();
40         if (frameCbemmTempoOption.getAdco().equalsIgnoreCase(adco)) {
41             updateStatesForCommonCbemmChannels(frameCbemmTempoOption);
42             updateStatesForTempoFrameOption(frameCbemmTempoOption);
43         }
44     }
45 }