]> git.basschouten.com Git - openhab-addons.git/blob
fe68a8954842f10fbae1759d72f4a8ffd3bb6a8b
[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.somfytahoma.internal.handler;
14
15 import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*;
16
17 import org.openhab.core.thing.Thing;
18
19 /**
20  * The {@link SomfyTahomaElectricitySensorHandler} is responsible for handling commands,
21  * which are sent to one of the channels of the electricity sensor thing.
22  *
23  * @author Ondrej Pecta - Initial contribution
24  */
25 public class SomfyTahomaElectricitySensorHandler extends SomfyTahomaBaseThingHandler {
26
27     public SomfyTahomaElectricitySensorHandler(Thing thing) {
28         super(thing);
29         stateNames.put(ENERGY_CONSUMPTION, ENERGY_CONSUMPTION_STATE);
30         // override state type because the cloud sends consumption in percent
31         cacheStateType(ENERGY_CONSUMPTION_STATE, TYPE_DECIMAL);
32     }
33 }