Added support for HAN-FUN outlets / simple on-off devices (#10760)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
572fd3dded
commit
04507d98fc
|
@ -84,6 +84,8 @@ The following sensors have been successfully tested using FRITZ!OS 7 for FRITZ!B
|
|||
- [SmartHome Bewegungsmelder](https://www.smarthome.de/geraete/telekom-smarthome-bewegungsmelder-innen) - a motion sensor (thing type `HAN_FUN_CONTACT`)
|
||||
- [SmartHome Rauchmelder](https://www.smarthome.de/geraete/smarthome-rauchmelder-weiss) - a smoke detector (thing type `HAN_FUN_CONTACT`)
|
||||
- [SmartHome Wandtaster](https://www.smarthome.de/geraete/telekom-smarthome-wandtaster) - a switch with two buttons (thing type `HAN_FUN_SWITCH`)
|
||||
- [SmartHome Zwischenstecker innen](https://www.smarthome.de/geraete/smarthome-zwischenstecker-innen-weiss) - a switchable indoor outlet (thing type `HAN_FUN_ON_OFF`)
|
||||
- [SmartHome Zwischenstecker außen](https://www.smarthome.de/geraete/smarthome-zwischenstecker-aussen-schwarz) - a switchable outdoor outlet (thing type `HAN_FUN_ON_OFF`)
|
||||
- [Rollotron DECT 1213](https://www.rademacher.de/shop/rollladen-sonnenschutz/elektrischer-gurtwickler/rollotron-dect-1213) - an electronic belt winder (thing type `HAN_FUN_BLINDS`)
|
||||
- [Becker BoxCTRL](https://becker-antriebe.shop/) - a radio controlled roller shutter drive (thing type `HAN_FUN_BLINDS`)
|
||||
|
||||
|
@ -176,6 +178,7 @@ The AIN (actor identification number) can be found in the FRITZ!Box interface ->
|
|||
| power | Number:Power | Current power consumption | FRITZ!DECT 210, FRITZ!DECT 200, FRITZ!Powerline 546E |
|
||||
| voltage | Number:ElectricPotential | Current voltage - FRITZ!OS 7 | FRITZ!DECT 210, FRITZ!DECT 200, FRITZ!Powerline 546E |
|
||||
| outlet | Switch | Switchable outlet (ON/OFF) | FRITZ!DECT 210, FRITZ!DECT 200, FRITZ!Powerline 546E |
|
||||
| on_off | Switch | Switchable device (ON/OFF) | HAN_FUN_ON_OFF |
|
||||
| actual_temp | Number:Temperature | Current temperature of heating thermostat | FRITZ!DECT 301, FRITZ!DECT 300, Comet DECT |
|
||||
| set_temp | Number:Temperature | Set Temperature of heating thermostat | FRITZ!DECT 301, FRITZ!DECT 300, Comet DECT |
|
||||
| eco_temp | Number:Temperature | Eco Temperature of heating thermostat | FRITZ!DECT 301, FRITZ!DECT 300, Comet DECT |
|
||||
|
|
|
@ -53,6 +53,7 @@ public class AVMFritzBindingConstants {
|
|||
public static final String DEVICE_COMETDECT = "Comet_DECT";
|
||||
public static final String DEVICE_HAN_FUN_CONTACT = "HAN_FUN_CONTACT";
|
||||
public static final String DEVICE_HAN_FUN_SWITCH = "HAN_FUN_SWITCH";
|
||||
public static final String DEVICE_HAN_FUN_ON_OFF = "HAN_FUN_ON_OFF";
|
||||
public static final String DEVICE_HAN_FUN_BLINDS = "HAN_FUN_BLINDS";
|
||||
|
||||
// List of main group types
|
||||
|
@ -74,6 +75,7 @@ public class AVMFritzBindingConstants {
|
|||
public static final ThingTypeUID COMETDECT_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_COMETDECT);
|
||||
public static final ThingTypeUID HAN_FUN_CONTACT_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_HAN_FUN_CONTACT);
|
||||
public static final ThingTypeUID HAN_FUN_SWITCH_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_HAN_FUN_SWITCH);
|
||||
public static final ThingTypeUID HAN_FUN_ON_OFF_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_HAN_FUN_ON_OFF);
|
||||
public static final ThingTypeUID HAN_FUN_BLINDS_THING_TYPE = new ThingTypeUID(BINDING_ID, DEVICE_HAN_FUN_BLINDS);
|
||||
public static final ThingTypeUID GROUP_HEATING_THING_TYPE = new ThingTypeUID(BINDING_ID, GROUP_HEATING);
|
||||
public static final ThingTypeUID GROUP_SWITCH_THING_TYPE = new ThingTypeUID(BINDING_ID, GROUP_SWITCH);
|
||||
|
@ -129,6 +131,7 @@ public class AVMFritzBindingConstants {
|
|||
public static final String CHANNEL_PRESS = "press";
|
||||
public static final String CHANNEL_LAST_CHANGE = "last_change";
|
||||
public static final String CHANNEL_ROLLERSHUTTER = "rollershutter";
|
||||
public static final String CHANNEL_ON_OFF = "on_off";
|
||||
|
||||
// List of all Channel config ids
|
||||
public static final String CONFIG_CHANNEL_TEMP_OFFSET = "offset";
|
||||
|
@ -169,7 +172,7 @@ public class AVMFritzBindingConstants {
|
|||
|
||||
public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES_UIDS = Set.of(DECT100_THING_TYPE,
|
||||
DECT200_THING_TYPE, DECT210_THING_TYPE, PL546E_THING_TYPE, HAN_FUN_CONTACT_THING_TYPE,
|
||||
HAN_FUN_BLINDS_THING_TYPE);
|
||||
HAN_FUN_ON_OFF_THING_TYPE, HAN_FUN_BLINDS_THING_TYPE);
|
||||
|
||||
public static final Set<ThingTypeUID> SUPPORTED_GROUP_THING_TYPES_UIDS = Set.of(GROUP_HEATING_THING_TYPE,
|
||||
GROUP_SWITCH_THING_TYPE);
|
||||
|
|
|
@ -17,6 +17,8 @@ import java.math.BigDecimal;
|
|||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* See {@link DeviceListModel}.
|
||||
*
|
||||
|
@ -34,6 +36,8 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
* <li>Bit 10: AVM DECT Repeater</li>
|
||||
* <li>Bit 11: Mikrofon</li>
|
||||
* <li>Bit 13: HAN-FUN Unit</li>
|
||||
* <li>Bit 15: an-/ausschaltbares Gerät / Steckdose / Lampe / Aktor</li>
|
||||
* <li>Bit 18: Rollladen - hoch, runter, stop und level 0% bis 100 %</li>
|
||||
* </ol>
|
||||
*
|
||||
* @author Robert Bausdorf - Initial contribution
|
||||
|
@ -53,6 +57,7 @@ public abstract class AVMFritzBaseModel implements BatteryModel {
|
|||
protected static final int DECT_REPEATER_BIT = 1 << 10; // Bit 10
|
||||
protected static final int MICROPHONE_BIT = 1 << 11; // Bit 11
|
||||
protected static final int HAN_FUN_UNIT_BIT = 1 << 13; // Bit 13
|
||||
protected static final int HAN_FUN_ON_OFF_BIT = 1 << 15; // Bit 15
|
||||
protected static final int HAN_FUN_BLINDS_BIT = 1 << 18; // Bit 18
|
||||
protected static final int HUMIDITY_SENSOR_BIT = 1 << 20; // Bit 20 - undocumented
|
||||
|
||||
|
@ -89,12 +94,19 @@ public abstract class AVMFritzBaseModel implements BatteryModel {
|
|||
@XmlElement(name = "switch")
|
||||
private SwitchModel switchModel;
|
||||
|
||||
@XmlElement(name = "simpleonoff")
|
||||
private @Nullable SimpleOnOffModel simpleOnOffUnit;
|
||||
|
||||
@XmlElement(name = "powermeter")
|
||||
private PowerMeterModel powermeterModel;
|
||||
|
||||
@XmlElement(name = "hkr")
|
||||
private HeatingModel heatingModel;
|
||||
|
||||
public @Nullable SimpleOnOffModel getSimpleOnOffUnit() {
|
||||
return simpleOnOffUnit;
|
||||
}
|
||||
|
||||
public PowerMeterModel getPowermeter() {
|
||||
return powermeterModel;
|
||||
}
|
||||
|
@ -151,7 +163,7 @@ public abstract class AVMFritzBaseModel implements BatteryModel {
|
|||
return (bitmask & OUTLET_BIT) > 0;
|
||||
}
|
||||
|
||||
public boolean isTempSensor() {
|
||||
public boolean isTemperatureSensor() {
|
||||
return (bitmask & TEMPERATURE_SENSOR_BIT) > 0;
|
||||
}
|
||||
|
||||
|
@ -171,7 +183,7 @@ public abstract class AVMFritzBaseModel implements BatteryModel {
|
|||
return (bitmask & HEATING_THERMOSTAT_BIT) > 0;
|
||||
}
|
||||
|
||||
public boolean isMicrophone() {
|
||||
public boolean hasMicrophone() {
|
||||
return (bitmask & MICROPHONE_BIT) > 0;
|
||||
}
|
||||
|
||||
|
@ -179,6 +191,10 @@ public abstract class AVMFritzBaseModel implements BatteryModel {
|
|||
return (bitmask & HAN_FUN_UNIT_BIT) > 0;
|
||||
}
|
||||
|
||||
public boolean isHANFUNOnOff() {
|
||||
return (bitmask / HAN_FUN_ON_OFF_BIT) > 0;
|
||||
}
|
||||
|
||||
public boolean isHANFUNBlinds() {
|
||||
return (bitmask & HAN_FUN_BLINDS_BIT) > 0;
|
||||
}
|
||||
|
@ -215,19 +231,19 @@ public abstract class AVMFritzBaseModel implements BatteryModel {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder().append("[ain=").append(ident).append(",bitmask=").append(bitmask)
|
||||
.append(",isHANFUNDevice=").append(isHANFUNDevice()).append(",isHANFUNButton=").append(isHANFUNButton())
|
||||
return new StringBuilder("[ain=").append(ident).append(",bitmask=").append(bitmask).append(",isHANFUNDevice=")
|
||||
.append(isHANFUNDevice()).append(",isHANFUNButton=").append(isHANFUNButton())
|
||||
.append(",isHANFUNAlarmSensor=").append(isHANFUNAlarmSensor()).append(",isButton=").append(isButton())
|
||||
.append(",isSwitchableOutlet=").append(isSwitchableOutlet()).append(",isTempSensor=")
|
||||
.append(isTempSensor()).append(",isHumiditySensor=").append(isHumiditySensor()).append(",isPowermeter=")
|
||||
.append(isPowermeter()).append(",isDectRepeater=").append(isDectRepeater())
|
||||
.append(",isHeatingThermostat=").append(isHeatingThermostat()).append(",isMicrophone=")
|
||||
.append(isMicrophone()).append(",isHANFUNUnit=").append(isHANFUNUnit()).append(",isHANFUNBlind=")
|
||||
.append(isHANFUNBlinds()).append(",id=").append(deviceId).append(",manufacturer=")
|
||||
.append(deviceManufacturer).append(",productname=").append(productName).append(",fwversion=")
|
||||
.append(firmwareVersion).append(",present=").append(present).append(",name=").append(name)
|
||||
.append(",battery=").append(getBattery()).append(",batterylow=").append(getBatterylow()).append(",")
|
||||
.append(getSwitch()).append(",").append(getPowermeter()).append(",").append(getHkr()).append(",")
|
||||
.toString();
|
||||
.append(",isSwitchableOutlet=").append(isSwitchableOutlet()).append(",isTemperatureSensor=")
|
||||
.append(isTemperatureSensor()).append(",isHumiditySensor=").append(isHumiditySensor())
|
||||
.append(",isPowermeter=").append(isPowermeter()).append(",isDectRepeater=").append(isDectRepeater())
|
||||
.append(",isHeatingThermostat=").append(isHeatingThermostat()).append(",hasMicrophone=")
|
||||
.append(hasMicrophone()).append(",isHANFUNUnit=").append(isHANFUNUnit()).append(",isHANFUNOnOff=")
|
||||
.append(isHANFUNOnOff()).append(",isHANFUNBlind=").append(isHANFUNBlinds()).append(",id=")
|
||||
.append(deviceId).append(",manufacturer=").append(deviceManufacturer).append(",productname=")
|
||||
.append(productName).append(",fwversion=").append(firmwareVersion).append(",present=").append(present)
|
||||
.append(",name=").append(name).append(",battery=").append(getBattery()).append(",batterylow=")
|
||||
.append(getBatterylow()).append(",").append(getSwitch()).append(",").append(getSimpleOnOffUnit())
|
||||
.append(",").append(getPowermeter()).append(",").append(getHkr()).append(",").toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,25 +90,30 @@ public class DeviceModel extends AVMFritzBaseModel {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder().append(super.toString()).append(temperature).append(",").append(humidity).append(",")
|
||||
return new StringBuilder(super.toString()).append(temperature).append(",").append(humidity).append(",")
|
||||
.append(alert).append(",").append(getButtons()).append(",").append(etsiunitinfo).append("]").toString();
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(propOrder = { "etsideviceid", "unittype", "interfaces" })
|
||||
public static class ETSUnitInfoModel {
|
||||
public static final String HAN_FUN_UNITTYPE_AC_OUTLET = "262";
|
||||
public static final String HAN_FUN_UNITTYPE_AC_OUTLET_SIMPLE_POWER_METERING = "263";
|
||||
public static final String HAN_FUN_UNITTYPE_SIMPLE_BUTTON = "273";
|
||||
public static final String HAN_FUN_UNITTYPE_SIMPLE_DETECTOR = "512";
|
||||
public static final String HAN_FUN_UNITTYPE_MAGNETIC_CONTACT = "513";
|
||||
public static final String HAN_FUN_UNITTYPE_OPTICAL_CONTACT = "514";
|
||||
public static final String HAN_FUN_UNITTYPE_DOOR_OPEN_CLOSE_DETECTOR = "513";
|
||||
public static final String HAN_FUN_UNITTYPE_WINDOW_OPEN_CLOSE_DETECTOR = "514";
|
||||
public static final String HAN_FUN_UNITTYPE_MOTION_DETECTOR = "515";
|
||||
public static final String HAN_FUN_UNITTYPE_SMOKE_DETECTOR = "516";
|
||||
public static final String HAN_FUN_UNITTYPE_SMOKE_DETECTOR = "516"; // undocumented
|
||||
public static final String HAN_FUN_UNITTYPE_FLOOD_DETECTOR = "518";
|
||||
public static final String HAN_FUN_UNITTYPE_GLAS_BREAK_DETECTOR = "519";
|
||||
public static final String HAN_FUN_UNITTYPE_VIBRATION_DETECTOR = "520";
|
||||
public static final String HAN_FUN_UNITTYPE_SIREN = "640";
|
||||
|
||||
public static final String HAN_FUN_INTERFACE_ALERT = "256";
|
||||
public static final String HAN_FUN_INTERFACE_KEEP_ALIVE = "277";
|
||||
public static final String HAN_FUN_INTERFACE_ON_OFF = "512";
|
||||
public static final String HAN_FUN_INTERFACE_SIMPLE_POWER_METERING = "768"; // undocumented
|
||||
public static final String HAN_FUN_INTERFACE_SIMPLE_BUTTON = "772";
|
||||
|
||||
private String etsideviceid;
|
||||
|
@ -141,8 +146,8 @@ public class DeviceModel extends AVMFritzBaseModel {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder().append("[etsideviceid=").append(etsideviceid).append(",unittype=")
|
||||
.append(unittype).append(",interfaces=").append(interfaces).append("]").toString();
|
||||
return new StringBuilder("[etsideviceid=").append(etsideviceid).append(",unittype=").append(unittype)
|
||||
.append(",interfaces=").append(interfaces).append("]").toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* Copyright (c) 2010-2021 Contributors to the openHAB project
|
||||
*
|
||||
* See the NOTICE file(s) distributed with this work for additional
|
||||
* information.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.openhab.binding.avmfritz.internal.dto;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* See {@link DeviceListModel}.
|
||||
*
|
||||
* @author Joshua Bacher - Initial contribution
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(propOrder = { "state" })
|
||||
public class SimpleOnOffModel {
|
||||
|
||||
public boolean state;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder("[state=").append(state).append(']').toString();
|
||||
}
|
||||
}
|
|
@ -336,6 +336,8 @@ public abstract class AVMFritzBaseBridgeHandler extends BaseBridgeHandler {
|
|||
return DEVICE_HAN_FUN_CONTACT;
|
||||
} else if (interfaces.contains(HAN_FUN_INTERFACE_SIMPLE_BUTTON)) {
|
||||
return DEVICE_HAN_FUN_SWITCH;
|
||||
} else if (interfaces.contains(HAN_FUN_INTERFACE_ON_OFF)) {
|
||||
return DEVICE_HAN_FUN_ON_OFF;
|
||||
}
|
||||
}
|
||||
return device.getProductName().replaceAll(INVALID_PATTERN, "_");
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.openhab.binding.avmfritz.internal.dto.HeatingModel.NextChangeModel;
|
|||
import org.openhab.binding.avmfritz.internal.dto.HumidityModel;
|
||||
import org.openhab.binding.avmfritz.internal.dto.LevelcontrolModel;
|
||||
import org.openhab.binding.avmfritz.internal.dto.PowerMeterModel;
|
||||
import org.openhab.binding.avmfritz.internal.dto.SimpleOnOffModel;
|
||||
import org.openhab.binding.avmfritz.internal.dto.SwitchModel;
|
||||
import org.openhab.binding.avmfritz.internal.dto.TemperatureModel;
|
||||
import org.openhab.binding.avmfritz.internal.hardware.FritzAhaStatusListener;
|
||||
|
@ -140,9 +141,12 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
|
|||
if (device.isHeatingThermostat()) {
|
||||
updateHeatingThermostat(device.getHkr());
|
||||
}
|
||||
if (device.isHANFUNUnit() && device.isHANFUNOnOff()) {
|
||||
updateSimpleOnOffUnit(device.getSimpleOnOffUnit());
|
||||
}
|
||||
if (device instanceof DeviceModel) {
|
||||
DeviceModel deviceModel = (DeviceModel) device;
|
||||
if (deviceModel.isTempSensor()) {
|
||||
if (deviceModel.isTemperatureSensor()) {
|
||||
updateTemperatureSensor(deviceModel.getTemperature());
|
||||
}
|
||||
if (deviceModel.isHumiditySensor()) {
|
||||
|
@ -225,8 +229,13 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
|
|||
if (lowBattery == null) {
|
||||
updateThingChannelState(CHANNEL_BATTERY_LOW, UnDefType.UNDEF);
|
||||
} else {
|
||||
updateThingChannelState(CHANNEL_BATTERY_LOW,
|
||||
BatteryModel.BATTERY_ON.equals(lowBattery) ? OnOffType.ON : OnOffType.OFF);
|
||||
updateThingChannelState(CHANNEL_BATTERY_LOW, OnOffType.from(BatteryModel.BATTERY_ON.equals(lowBattery)));
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSimpleOnOffUnit(@Nullable SimpleOnOffModel simpleOnOffUnit) {
|
||||
if (simpleOnOffUnit != null) {
|
||||
updateThingChannelState(CHANNEL_ON_OFF, OnOffType.from(simpleOnOffUnit.state));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -241,7 +250,7 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
|
|||
if (state == null) {
|
||||
updateThingChannelState(CHANNEL_OUTLET, UnDefType.UNDEF);
|
||||
} else {
|
||||
updateThingChannelState(CHANNEL_OUTLET, SwitchModel.ON.equals(state) ? OnOffType.ON : OnOffType.OFF);
|
||||
updateThingChannelState(CHANNEL_OUTLET, OnOffType.from(SwitchModel.ON.equals(state)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -370,11 +379,9 @@ public abstract class AVMFritzBaseThingHandler extends BaseThingHandler implemen
|
|||
logger.debug("Channel {} is a read-only channel and cannot handle command '{}'", channelId, command);
|
||||
break;
|
||||
case CHANNEL_OUTLET:
|
||||
case CHANNEL_ON_OFF:
|
||||
if (command instanceof OnOffType) {
|
||||
fritzBox.setSwitch(ain, OnOffType.ON.equals(command));
|
||||
if (state != null) {
|
||||
state.getSwitch().setState(OnOffType.ON.equals(command) ? SwitchModel.ON : SwitchModel.OFF);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CHANNEL_SETTEMP:
|
||||
|
|
|
@ -66,10 +66,6 @@ public class Powerline546EHandler extends AVMFritzBaseBridgeHandler implements F
|
|||
|
||||
private final Logger logger = LoggerFactory.getLogger(Powerline546EHandler.class);
|
||||
|
||||
/**
|
||||
* keeps track of the current state for handling of increase/decrease
|
||||
*/
|
||||
private @Nullable AVMFritzBaseModel state;
|
||||
private @Nullable String identifier;
|
||||
|
||||
/**
|
||||
|
@ -128,7 +124,6 @@ public class Powerline546EHandler extends AVMFritzBaseBridgeHandler implements F
|
|||
} else {
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Device not present");
|
||||
}
|
||||
state = device;
|
||||
|
||||
updateProperties(device);
|
||||
|
||||
|
@ -272,11 +267,8 @@ public class Powerline546EHandler extends AVMFritzBaseBridgeHandler implements F
|
|||
}
|
||||
break;
|
||||
case CHANNEL_OUTLET:
|
||||
fritzBox.setSwitch(ain, OnOffType.ON.equals(command));
|
||||
if (command instanceof OnOffType) {
|
||||
if (state != null) {
|
||||
state.getSwitch().setState(OnOffType.ON.equals(command) ? SwitchModel.ON : SwitchModel.OFF);
|
||||
}
|
||||
fritzBox.setSwitch(ain, OnOffType.ON.equals(command));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -13,6 +13,12 @@ thing-type.avmfritz.HAN_FUN_CONTACT.description = HAN-FUN Kontakt (e.g. SmartHom
|
|||
thing-type.avmfritz.HAN_FUN_SWITCH.label = HAN-FUN Schalter
|
||||
thing-type.avmfritz.HAN_FUN_SWITCH.description = HAN-FUN Schalter (e.g. SmartHome Wandtaster).
|
||||
|
||||
thing-type.avmfritz.HAN_FUN_BLINDS.label = HAN-FUN Rollladen
|
||||
thing-type.avmfritz.HAN_FUN_BLINDS.description = HAN-FUN Rollladen (z.B. Rollotron DECT 1213, Becker BoxCTRL).
|
||||
|
||||
thing-type.avmfritz.HAN_FUN_ON_OFF.label = HAN-FUN an-/ausschaltbares Gerät
|
||||
thing-type.avmfritz.HAN_FUN_ON_OFF.description = HAN-FUN an-/ausschaltbares Gerät (e.g. SmartHome Zwischenstecker innen / SmartHome Zwischenstecker außen).
|
||||
|
||||
# bridge types config groups
|
||||
bridge-type.config.avmfritz.fritzbox.group.network.label = Netzwerk
|
||||
bridge-type.config.avmfritz.fritzbox.group.network.description = Einstellungen für das Netzwerk.
|
||||
|
@ -99,9 +105,6 @@ thing-type.avmfritz.FRITZ_DECT_440.description = FRITZ!DECT 440 Taster. Dient zu
|
|||
|
||||
thing-type.avmfritz.FRITZ_Powerline_546E.description = FRITZ!Powerline 546E schaltbare Steckdose. Dient zur Steuerung der integrierten Steckdose und liefert Daten wie z.B. Temperatur.
|
||||
|
||||
thing-type.avmfritz.HAN_FUN_BLINDS.label = HAN-FUN Rollladen
|
||||
thing-type.avmfritz.HAN_FUN_BLINDS.description = HAN-FUN Rollladen (z.B. Rollotron DECT 1213, Becker BoxCTRL).
|
||||
|
||||
# thing types config groups
|
||||
thing-type.avmfritz.FRITZ_GROUP_HEATING.label = Heizkörperregler
|
||||
thing-type.avmfritz.FRITZ_GROUP_HEATING.description = Gruppe für Heizkörperregler. Dient zur Steuerung von Heizkörpern und liefert Daten wie z.B. Temperatur.
|
||||
|
|
|
@ -295,6 +295,24 @@
|
|||
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
|
||||
</thing-type>
|
||||
|
||||
<thing-type id="HAN_FUN_ON_OFF">
|
||||
<supported-bridge-type-refs>
|
||||
<bridge-type-ref id="fritzbox"/>
|
||||
<bridge-type-ref id="FRITZ_Powerline_546E_Solo"/>
|
||||
</supported-bridge-type-refs>
|
||||
|
||||
<label>HAN-FUN On / Off Device</label>
|
||||
<description>HAN-FUN switchable device (e.g. SmartHome Zwischenstecker innen / SmartHome Zwischenstecker außen)</description>
|
||||
|
||||
<channels>
|
||||
<channel id="on_off" typeId="system.power"/>
|
||||
</channels>
|
||||
|
||||
<representation-property>ain</representation-property>
|
||||
|
||||
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
|
||||
</thing-type>
|
||||
|
||||
<!-- Supported FRITZ! groups and features -->
|
||||
<thing-type id="FRITZ_GROUP_HEATING">
|
||||
<supported-bridge-type-refs>
|
||||
|
|
|
@ -45,21 +45,47 @@ public class AVMFritzDeviceListModelTest {
|
|||
public void setUp() throws JAXBException, XMLStreamException {
|
||||
//@formatter:off
|
||||
final String xml =
|
||||
"<devicelist version=\"1\">" +
|
||||
"<group identifier=\"F0:A3:7F-900\" id=\"20000\" functionbitmask=\"6784\" fwversion=\"1.0\" manufacturer=\"AVM\" productname=\"\"><present>1</present><name>Schlafzimmer</name><switch><state>1</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter><groupinfo><masterdeviceid>17</masterdeviceid><members>17,18</members></groupinfo></group>" +
|
||||
"<group identifier=\"F0:A3:7F-901\" id=\"20001\" functionbitmask=\"4160\" fwversion=\"1.0\" manufacturer=\"AVM\" productname=\"\"><present>1</present><name>Schlafzimmer</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr><groupinfo><masterdeviceid>0</masterdeviceid><members>20,21,22</members></groupinfo></group>" +
|
||||
"<device identifier=\"08761 0000434\" id=\"17\" functionbitmask=\"2944\" fwversion=\"03.83\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 200\"><present>1</present><name>FRITZ!DECT 200 #1</name><switch><state>1</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter><temperature><celsius>255</celsius><offset>0</offset></temperature></device>" +
|
||||
"<device identifier=\"08761 0000438\" id=\"18\" functionbitmask=\"2944\" fwversion=\"03.83\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 210\"><present>1</present><name>FRITZ!DECT 210 #8</name><switch><state>1</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter><temperature><celsius>255</celsius><offset>0</offset></temperature></device>" +
|
||||
"<device identifier=\"08761 0000437\" id=\"20\" functionbitmask=\"320\" fwversion=\"03.50\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 300\"><present>0</present><name>FRITZ!DECT 300 #1</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr></device>" +
|
||||
"<device identifier=\"08761 0000436\" id=\"21\" functionbitmask=\"320\" fwversion=\"03.50\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 301\"><present>0</present><name>FRITZ!DECT 301 #1</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr></device>" +
|
||||
"<device identifier=\"08761 0000435\" id=\"22\" functionbitmask=\"320\" fwversion=\"03.50\" manufacturer=\"AVM\" productname=\"Comet DECT\"><present>0</present><name>Comet DECT #1</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr></device>" +
|
||||
"<device identifier=\"5C:49:79:F0:A3:84\" id=\"30\" functionbitmask=\"640\" fwversion=\"06.92\" manufacturer=\"AVM\" productname=\"FRITZ!Powerline 546E\"><present>1</present><name>FRITZ!Powerline 546E #1</name><switch><state>0</state><mode>manuell</mode><lock>0</lock><devicelock>1</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter></device>" +
|
||||
"<device identifier=\"08761 0000439\" id=\"40\" functionbitmask=\"1280\" fwversion=\"03.86\" manufacturer=\"AVM\" productname=\"FRITZ!DECT Repeater 100\"><present>1</present><name>FRITZ!DECT Repeater 100 #5</name><temperature><celsius>230</celsius><offset>0</offset></temperature></device>" +
|
||||
"<device identifier=\"11934 0059978-1\" id=\"2000\" functionbitmask=\"8208\" fwversion=\"0.0\" manufacturer=\"0x0feb\" productname=\"HAN-FUN\"><present>0</present><name>HAN-FUN #2: Unit #2</name><etsiunitinfo><etsideviceid>406</etsideviceid><unittype>514</unittype><interfaces>256</interfaces></etsiunitinfo><alert><state>1</state></alert></device>" +
|
||||
"<device identifier=\"11934 0059979-1\" id=\"2001\" functionbitmask=\"8200\" fwversion=\"0.0\" manufacturer=\"0x0feb\" productname=\"HAN-FUN\"><present>0</present><name>HAN-FUN #2: Unit #2</name><etsiunitinfo><etsideviceid>412</etsideviceid><unittype>273</unittype><interfaces>772</interfaces></etsiunitinfo><button><lastpressedtimestamp>1529590797</lastpressedtimestamp></button></device>" +
|
||||
"<device identifier=\"13096 0007307\" id=\"29\" functionbitmask=\"32\" fwversion=\"04.90\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 400\"><present>1</present><name>FRITZ!DECT 400 #14</name><battery>100</battery><batterylow>0</batterylow><button identifier=\"13096 0007307-0\" id=\"5000\"><name>FRITZ!DECT 400 #14: kurz</name><lastpressedtimestamp>1549195586</lastpressedtimestamp></button><button identifier=\"13096 0007307-9\" id=\"5001\"><name>FRITZ!DECT 400 #14: lang</name><lastpressedtimestamp>1549195595</lastpressedtimestamp></button></device>" +
|
||||
"<device identifier=\"13096 0007308\" id=\"30\" functionbitmask=\"1048864\" fwversion=\"05.10\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 440\"><present>1</present><name>FRITZ!DECT 440 #15</name><temperature><celsius>230</celsius><offset>0</offset></temperature><humidity><rel_humidity>43</rel_humidity></humidity><battery>100</battery><batterylow>0</batterylow><button identifier=\"13096 0007308-1\" id=\"5000\"><name>FRITZ!DECT 440 #15: Oben rechts</name><lastpressedtimestamp>1549195586</lastpressedtimestamp></button><button identifier=\"13096 0007308-3\" id=\"5001\"><name>FRITZ!DECT 440 #15: Unten rechts</name><lastpressedtimestamp>1549195595</lastpressedtimestamp></button><button identifier=\"13096 0007308-5\" id=\"5002\"><name>FRITZ!DECT 440 #15: Unten links</name><lastpressedtimestamp>1549195586</lastpressedtimestamp></button><button identifier=\"13096 0007308-7\" id=\"5003\"><name>FRITZ!DECT 440 #15: Oben links</name><lastpressedtimestamp>1549195595</lastpressedtimestamp></button></device>" +
|
||||
"<device identifier=\"14276 0503450-1\" id=\"2000\" functionbitmask=\"335888\" fwversion=\"0.0\" manufacturer=\"0x37c4\" productname=\"Rollotron 1213\"><present>1</present><txbusy>0</txbusy><name>Rollotron 1213 #1</name><blind><endpositionsset>1</endpositionsset><mode>manuell</mode></blind><levelcontrol><level>26</level><levelpercentage>10</levelpercentage></levelcontrol><etsiunitinfo><etsideviceid>406</etsideviceid><unittype>281</unittype><interfaces>256,513,516,517</interfaces></etsiunitinfo><alert><state>0</state><lastalertchgtimestamp></lastalertchgtimestamp></alert></device>" +
|
||||
"<devicelist version=\"1\">"
|
||||
+ "<group identifier=\"F0:A3:7F-900\" id=\"20000\" functionbitmask=\"6784\" fwversion=\"1.0\" manufacturer=\"AVM\" productname=\"\"><present>1</present><name>Schlafzimmer</name><switch><state>1</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter><groupinfo><masterdeviceid>17</masterdeviceid><members>17,18</members></groupinfo></group>"
|
||||
+ "<group identifier=\"F0:A3:7F-901\" id=\"20001\" functionbitmask=\"4160\" fwversion=\"1.0\" manufacturer=\"AVM\" productname=\"\"><present>1</present><name>Schlafzimmer</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr><groupinfo><masterdeviceid>0</masterdeviceid><members>20,21,22</members></groupinfo></group>"
|
||||
+ "<device identifier=\"08761 0000434\" id=\"17\" functionbitmask=\"35712\" fwversion=\"03.83\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 200\"><present>1</present><name>FRITZ!DECT 200 #1</name><switch><state>1</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter><temperature><celsius>255</celsius><offset>0</offset></temperature></device>"
|
||||
+ "<device identifier=\"08761 0000438\" id=\"18\" functionbitmask=\"35712\" fwversion=\"03.83\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 210\"><present>1</present><name>FRITZ!DECT 210 #8</name><switch><state>1</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter><temperature><celsius>255</celsius><offset>0</offset></temperature></device>"
|
||||
+ "<device identifier=\"08761 0000437\" id=\"20\" functionbitmask=\"320\" fwversion=\"03.50\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 300\"><present>0</present><name>FRITZ!DECT 300 #1</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr></device>"
|
||||
+ "<device identifier=\"08761 0000436\" id=\"21\" functionbitmask=\"320\" fwversion=\"03.50\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 301\"><present>0</present><name>FRITZ!DECT 301 #1</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr></device>"
|
||||
+ "<device identifier=\"08761 0000435\" id=\"22\" functionbitmask=\"320\" fwversion=\"03.50\" manufacturer=\"AVM\" productname=\"Comet DECT\"><present>0</present><name>Comet DECT #1</name><temperature><celsius>220</celsius><offset>-10</offset></temperature><hkr><tist>44</tist><tsoll>42</tsoll><absenk>28</absenk><komfort>42</komfort><lock>1</lock><devicelock>1</devicelock><errorcode>0</errorcode><windowopenactiv>0</windowopenactiv><windowopenactiveendtime>0</windowopenactiveendtime><boostactive>0</boostactive><boostactiveendtime>0</boostactiveendtime><batterylow>0</batterylow><battery>100</battery><nextchange><endperiod>1484341200</endperiod><tchange>28</tchange></nextchange></hkr></device>"
|
||||
+ "<device identifier=\"5C:49:79:F0:A3:84\" id=\"30\" functionbitmask=\"640\" fwversion=\"06.92\" manufacturer=\"AVM\" productname=\"FRITZ!Powerline 546E\"><present>1</present><name>FRITZ!Powerline 546E #1</name><switch><state>0</state><mode>manuell</mode><lock>0</lock><devicelock>1</devicelock></switch><powermeter><voltage>230051</voltage><power>0</power><energy>2087</energy></powermeter></device>"
|
||||
+ "<device identifier=\"08761 0000439\" id=\"40\" functionbitmask=\"1280\" fwversion=\"03.86\" manufacturer=\"AVM\" productname=\"FRITZ!DECT Repeater 100\"><present>1</present><name>FRITZ!DECT Repeater 100 #5</name><temperature><celsius>230</celsius><offset>0</offset></temperature></device>"
|
||||
+ "<device identifier=\"11934 0059978-1\" id=\"2000\" functionbitmask=\"8208\" fwversion=\"0.0\" manufacturer=\"0x0feb\" productname=\"HAN-FUN\"><present>0</present><name>HAN-FUN #2: Unit #2</name><etsiunitinfo><etsideviceid>406</etsideviceid><unittype>514</unittype><interfaces>256</interfaces></etsiunitinfo><alert><state>1</state></alert></device>"
|
||||
+ "<device identifier=\"11934 0059979-1\" id=\"2001\" functionbitmask=\"8200\" fwversion=\"0.0\" manufacturer=\"0x0feb\" productname=\"HAN-FUN\"><present>0</present><name>HAN-FUN #2: Unit #2</name><etsiunitinfo><etsideviceid>412</etsideviceid><unittype>273</unittype><interfaces>772</interfaces></etsiunitinfo><button><lastpressedtimestamp>1529590797</lastpressedtimestamp></button></device>"
|
||||
+ "<device identifier=\"13096 0007307\" id=\"29\" functionbitmask=\"32\" fwversion=\"04.90\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 400\"><present>1</present><name>FRITZ!DECT 400 #14</name><battery>100</battery><batterylow>0</batterylow><button identifier=\"13096 0007307-0\" id=\"5000\"><name>FRITZ!DECT 400 #14: kurz</name><lastpressedtimestamp>1549195586</lastpressedtimestamp></button><button identifier=\"13096 0007307-9\" id=\"5001\"><name>FRITZ!DECT 400 #14: lang</name><lastpressedtimestamp>1549195595</lastpressedtimestamp></button></device>"
|
||||
+ "<device identifier=\"13096 0007308\" id=\"30\" functionbitmask=\"1048864\" fwversion=\"05.10\" manufacturer=\"AVM\" productname=\"FRITZ!DECT 440\"><present>1</present><name>FRITZ!DECT 440 #15</name><temperature><celsius>230</celsius><offset>0</offset></temperature><humidity><rel_humidity>43</rel_humidity></humidity><battery>100</battery><batterylow>0</batterylow><button identifier=\"13096 0007308-1\" id=\"5000\"><name>FRITZ!DECT 440 #15: Oben rechts</name><lastpressedtimestamp>1549195586</lastpressedtimestamp></button><button identifier=\"13096 0007308-3\" id=\"5001\"><name>FRITZ!DECT 440 #15: Unten rechts</name><lastpressedtimestamp>1549195595</lastpressedtimestamp></button><button identifier=\"13096 0007308-5\" id=\"5002\"><name>FRITZ!DECT 440 #15: Unten links</name><lastpressedtimestamp>1549195586</lastpressedtimestamp></button><button identifier=\"13096 0007308-7\" id=\"5003\"><name>FRITZ!DECT 440 #15: Oben links</name><lastpressedtimestamp>1549195595</lastpressedtimestamp></button></device>"
|
||||
+ "<device identifier=\"14276 0503450-1\" id=\"2000\" functionbitmask=\"335888\" fwversion=\"0.0\" manufacturer=\"0x37c4\" productname=\"Rollotron 1213\"><present>1</present><txbusy>0</txbusy><name>Rollotron 1213 #1</name><blind><endpositionsset>1</endpositionsset><mode>manuell</mode></blind><levelcontrol><level>26</level><levelpercentage>10</levelpercentage></levelcontrol><etsiunitinfo><etsideviceid>406</etsideviceid><unittype>281</unittype><interfaces>256,513,516,517</interfaces></etsiunitinfo><alert><state>0</state><lastalertchgtimestamp></lastalertchgtimestamp></alert></device>"
|
||||
+ "<device identifier=\"11324 0824499-1\" id=\"2002\" functionbitmask=\"40960\" fwversion=\"0.0\" manufacturer=\"0x2c3c\" productname=\"HAN-FUN\">\n"
|
||||
+ " <present>1</present>\n"
|
||||
+ " <txbusy>0</txbusy>\n"
|
||||
+ " <name>Steckdose innen</name>\n"
|
||||
+ " <simpleonoff>\n"
|
||||
+ " <state>0</state>\n"
|
||||
+ " </simpleonoff>\n"
|
||||
+ " <etsiunitinfo>\n"
|
||||
+ " <etsideviceid>408</etsideviceid>\n"
|
||||
+ " <unittype>263</unittype>\n"
|
||||
+ " <interfaces>512,768</interfaces>\n"
|
||||
+ " </etsiunitinfo>\n"
|
||||
+ "</device>"
|
||||
+ "<device identifier=\"11324 0584796-1\" id=\"2001\" functionbitmask=\"40960\" fwversion=\"0.0\" manufacturer=\"0x2c3c\" productname=\"HAN-FUN\">\n"
|
||||
+ " <present>1</present>\n"
|
||||
+ " <txbusy>0</txbusy>\n"
|
||||
+ " <name>Steckdose außen</name>\n"
|
||||
+ " <simpleonoff>\n"
|
||||
+ " <state>0</state>\n"
|
||||
+ " </simpleonoff>\n"
|
||||
+ " <etsiunitinfo>\n"
|
||||
+ " <etsideviceid>407</etsideviceid>\n"
|
||||
+ " <unittype>262</unittype>\n"
|
||||
+ " <interfaces>512</interfaces>\n"
|
||||
+ " </etsiunitinfo>\n"
|
||||
+ "</device>" +
|
||||
"</devicelist>";
|
||||
//@formatter:on
|
||||
XMLStreamReader xsr = JAXBUtils.XMLINPUTFACTORY.createXMLStreamReader(new StringReader(xml));
|
||||
|
@ -70,7 +96,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
@Test
|
||||
public void validateDeviceListModel() {
|
||||
assertNotNull(devices);
|
||||
assertEquals(14, devices.getDevicelist().size());
|
||||
assertEquals(16, devices.getDevicelist().size());
|
||||
assertEquals("1", devices.getXmlApiVersion());
|
||||
}
|
||||
|
||||
|
@ -95,7 +121,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertTrue(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertTrue(device.isTempSensor());
|
||||
assertTrue(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
|
@ -130,16 +156,19 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertEquals(1, device.getPresent());
|
||||
assertEquals("FRITZ!DECT 200 #1", device.getName());
|
||||
|
||||
assertFalse(device.isButton());
|
||||
assertFalse(device.isHANFUNButton());
|
||||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertTrue(device.isSwitchableOutlet());
|
||||
assertTrue(device.isTempSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertTrue(device.isPowermeter());
|
||||
assertFalse(device.isButton());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
assertTrue(device.isPowermeter());
|
||||
assertTrue(device.isTemperatureSensor());
|
||||
assertTrue(device.isSwitchableOutlet());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertTrue(device.hasMicrophone());
|
||||
assertFalse(device.isHANFUNUnit());
|
||||
assertTrue(device.isHANFUNOnOff());
|
||||
assertFalse(device.isHANFUNBlinds());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
|
||||
assertNotNull(device.getSwitch());
|
||||
assertEquals(SwitchModel.ON, device.getSwitch().getState());
|
||||
|
@ -174,16 +203,19 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertEquals(1, device.getPresent());
|
||||
assertEquals("FRITZ!DECT 210 #8", device.getName());
|
||||
|
||||
assertFalse(device.isButton());
|
||||
assertFalse(device.isHANFUNButton());
|
||||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertTrue(device.isSwitchableOutlet());
|
||||
assertTrue(device.isTempSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertTrue(device.isPowermeter());
|
||||
assertFalse(device.isButton());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
assertTrue(device.isPowermeter());
|
||||
assertTrue(device.isTemperatureSensor());
|
||||
assertTrue(device.isSwitchableOutlet());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertTrue(device.hasMicrophone());
|
||||
assertFalse(device.isHANFUNUnit());
|
||||
assertTrue(device.isHANFUNOnOff());
|
||||
assertFalse(device.isHANFUNBlinds());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
|
||||
assertNotNull(device.getSwitch());
|
||||
assertEquals(SwitchModel.ON, device.getSwitch().getState());
|
||||
|
@ -223,7 +255,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertTrue(device.isTempSensor());
|
||||
assertTrue(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertTrue(device.isHeatingThermostat());
|
||||
|
@ -261,7 +293,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertTrue(device.isTempSensor());
|
||||
assertTrue(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertTrue(device.isHeatingThermostat());
|
||||
|
@ -299,7 +331,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertTrue(device.isTempSensor());
|
||||
assertTrue(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertTrue(device.isHeatingThermostat());
|
||||
|
@ -337,7 +369,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertFalse(device.isTempSensor());
|
||||
assertFalse(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
|
@ -386,7 +418,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertTrue(device.isTempSensor());
|
||||
assertTrue(device.isTemperatureSensor());
|
||||
assertTrue(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
|
@ -456,7 +488,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertTrue(device.isSwitchableOutlet());
|
||||
assertFalse(device.isTempSensor());
|
||||
assertFalse(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertTrue(device.isPowermeter());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
|
@ -498,7 +530,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertTrue(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertFalse(device.isTempSensor());
|
||||
assertFalse(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
|
@ -541,7 +573,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertFalse(device.isTempSensor());
|
||||
assertFalse(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
|
@ -584,7 +616,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertTrue(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertFalse(device.isTempSensor());
|
||||
assertFalse(device.isTemperatureSensor());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
|
@ -609,6 +641,55 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertEquals(BigDecimal.valueOf(10L), levelcontrol.getLevelPercentage());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validateHANFUNOnOffModel() {
|
||||
Optional<AVMFritzBaseModel> optionalDevice = findModelByIdentifier("113240824499-1");
|
||||
assertTrue(optionalDevice.isPresent());
|
||||
assertTrue(optionalDevice.get() instanceof DeviceModel);
|
||||
|
||||
DeviceModel device = (DeviceModel) optionalDevice.get();
|
||||
assertEquals("HAN-FUN", device.getProductName());
|
||||
assertEquals("113240824499-1", device.getIdentifier());
|
||||
assertEquals("2002", device.getDeviceId());
|
||||
assertEquals("0.0", device.getFirmwareVersion());
|
||||
assertEquals("0x2c3c", device.getManufacturer());
|
||||
|
||||
assertEquals(1, device.getPresent());
|
||||
assertEquals("Steckdose innen", device.getName());
|
||||
|
||||
assertFalse(device.isHANFUNButton());
|
||||
assertFalse(device.isHANFUNAlarmSensor());
|
||||
assertFalse(device.isButton());
|
||||
assertFalse(device.isHeatingThermostat());
|
||||
assertFalse(device.isPowermeter());
|
||||
assertFalse(device.isTemperatureSensor());
|
||||
assertFalse(device.isSwitchableOutlet());
|
||||
assertFalse(device.isDectRepeater());
|
||||
assertFalse(device.hasMicrophone());
|
||||
assertTrue(device.isHANFUNUnit());
|
||||
assertTrue(device.isHANFUNOnOff());
|
||||
assertFalse(device.isHANFUNBlinds());
|
||||
assertFalse(device.isHumiditySensor());
|
||||
|
||||
assertTrue(device.getButtons().isEmpty());
|
||||
|
||||
assertNull(device.getAlert());
|
||||
|
||||
assertNull(device.getSwitch());
|
||||
|
||||
assertNull(device.getTemperature());
|
||||
|
||||
SimpleOnOffModel model = device.getSimpleOnOffUnit();
|
||||
assertNotNull(model);
|
||||
assertEquals(false, model.state);
|
||||
|
||||
assertNull(device.getPowermeter());
|
||||
|
||||
assertNull(device.getHkr());
|
||||
|
||||
assertNull(device.getLevelcontrol());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validateHeatingGroupModel() {
|
||||
Optional<AVMFritzBaseModel> optionalGroup = findModelByIdentifier("F0:A3:7F-901");
|
||||
|
@ -630,7 +711,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(group.isHANFUNAlarmSensor());
|
||||
assertFalse(group.isDectRepeater());
|
||||
assertFalse(group.isSwitchableOutlet());
|
||||
assertFalse(group.isTempSensor());
|
||||
assertFalse(group.isTemperatureSensor());
|
||||
assertFalse(group.isHumiditySensor());
|
||||
assertFalse(group.isPowermeter());
|
||||
assertTrue(group.isHeatingThermostat());
|
||||
|
@ -668,7 +749,7 @@ public class AVMFritzDeviceListModelTest {
|
|||
assertFalse(group.isHANFUNAlarmSensor());
|
||||
assertFalse(group.isDectRepeater());
|
||||
assertTrue(group.isSwitchableOutlet());
|
||||
assertFalse(group.isTempSensor());
|
||||
assertFalse(group.isTemperatureSensor());
|
||||
assertFalse(group.isHumiditySensor());
|
||||
assertTrue(group.isPowermeter());
|
||||
assertFalse(group.isHeatingThermostat());
|
||||
|
|
|
@ -89,7 +89,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
|
|||
|
||||
@Test
|
||||
public void correctSupportedTypes() {
|
||||
assertEquals(14, discovery.getSupportedThingTypes().size());
|
||||
assertEquals(15, discovery.getSupportedThingTypes().size());
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(DECT100_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(DECT200_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(DECT210_THING_TYPE));
|
||||
|
@ -101,6 +101,7 @@ public class AVMFritzDiscoveryServiceOSGiTest extends AVMFritzThingHandlerOSGiTe
|
|||
assertTrue(discovery.getSupportedThingTypes().contains(COMETDECT_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(HAN_FUN_CONTACT_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(HAN_FUN_SWITCH_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(HAN_FUN_ON_OFF_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(HAN_FUN_BLINDS_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(GROUP_HEATING_THING_TYPE));
|
||||
assertTrue(discovery.getSupportedThingTypes().contains(GROUP_SWITCH_THING_TYPE));
|
||||
|
|
Loading…
Reference in New Issue