- `port` (optional, 1 to 65535), no default (derived from protocol: 80 or 443)
- `password` (optional for call monitoring, but mandatory for AHA features), no default (depends on FRITZ!Box security configuration)
- `user` (optional), no default (depends on FRITZ!Box security configuration)
-- `pollingInterval` (optional, 5 to 60), default 15 (in seconds)
+- `pollingInterval` (optional, 1 to 60), default 15 (in seconds)
- `asyncTimeout` (optional, 1000 to 60000), default 10000 (in milliseconds)
- `syncTimeout` (optional, 500 to 15000), default 2000 (in milliseconds)
- `protocol` (optional, "http" or "https"), default "http"
- `port` (optional, 1 to 65535), no default (derived from protocol: 80 or 443)
- `password` (optional), no default (depends on FRITZ!Powerline security configuration)
-- `pollingInterval` (optional, 5 to 60), default 15 (in seconds)
+- `pollingInterval` (optional, 1 to 60), default 15 (in seconds)
- `asyncTimeout` (optional, 1000 to 60000), default 10000 (in milliseconds)
- `syncTimeout` (optional, 500 to 15000), default 2000 (in milliseconds)
/**
* Refresh interval which is used to poll values from the FRITZ!Box web interface (optional, defaults to 15 s)
*/
- private long refreshInterval = 15;
+ private long pollingInterval = 15;
/**
* Interface object for querying the FRITZ!Box web interface
"The 'ipAddress' parameter must be configured.");
configValid = false;
}
- refreshInterval = config.pollingInterval;
- if (refreshInterval < 5) {
+ pollingInterval = config.pollingInterval;
+ if (pollingInterval < 1) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
- "The 'pollingInterval' parameter must be greater then at least 5 seconds.");
+ "The 'pollingInterval' parameter must be greater than or equals to 1 second.");
configValid = false;
}
protected void startPolling() {
ScheduledFuture<?> localPollingJob = pollingJob;
if (localPollingJob == null || localPollingJob.isCancelled()) {
- logger.debug("Start polling job at interval {}s", refreshInterval);
- pollingJob = scheduler.scheduleWithFixedDelay(this::poll, INITIAL_DELAY, refreshInterval, TimeUnit.SECONDS);
+ logger.debug("Start polling job at interval {}s", pollingInterval);
+ pollingJob = scheduler.scheduleWithFixedDelay(this::poll, INITIAL_DELAY, pollingInterval, TimeUnit.SECONDS);
}
}
private ChannelTypeUID createChannelTypeUID(String channelId) {
int pos = channelId.indexOf(ChannelUID.CHANNEL_GROUP_SEPARATOR);
String id = pos > -1 ? channelId.substring(pos + 1) : channelId;
- return CHANNEL_BATTERY.equals(id) ? DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_BATTERY_LEVEL.getUID()
- : new ChannelTypeUID(BINDING_ID, id);
+ final ChannelTypeUID channelTypeUID;
+ switch (id) {
+ case CHANNEL_BATTERY:
+ channelTypeUID = DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_BATTERY_LEVEL.getUID();
+ break;
+ case CHANNEL_VOLTAGE:
+ channelTypeUID = DefaultSystemChannelTypeProvider.SYSTEM_ELECTRIC_VOLTAGE.getUID();
+ break;
+ default:
+ channelTypeUID = new ChannelTypeUID(BINDING_ID, id);
+ break;
+ }
+ return channelTypeUID;
}
/**
private void createChannel(String channelId) {
ThingHandlerCallback callback = getCallback();
if (callback != null) {
- ChannelUID channelUID = new ChannelUID(thing.getUID(), channelId);
- ChannelTypeUID channelTypeUID = createChannelTypeUID(channelId);
- Channel channel = callback.createChannelBuilder(channelUID, channelTypeUID).build();
+ final ChannelUID channelUID = new ChannelUID(thing.getUID(), channelId);
+ final ChannelTypeUID channelTypeUID = createChannelTypeUID(channelId);
+ final Channel channel = callback.createChannelBuilder(channelUID, channelTypeUID).build();
updateThing(editThing().withoutChannel(channelUID).withChannel(channel).build());
}
}
}
}
+ /**
+ * Creates a {@link ChannelTypeUID} from the given channel id.
+ *
+ * @param channelId ID of the channel type UID to be created.
+ * @return the channel type UID
+ */
+ private ChannelTypeUID createChannelTypeUID(String channelId) {
+ final ChannelTypeUID channelTypeUID;
+ switch (channelId) {
+ case CHANNEL_BATTERY:
+ channelTypeUID = DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_BATTERY_LEVEL.getUID();
+ break;
+ case CHANNEL_VOLTAGE:
+ channelTypeUID = DefaultSystemChannelTypeProvider.SYSTEM_ELECTRIC_VOLTAGE.getUID();
+ break;
+ default:
+ channelTypeUID = new ChannelTypeUID(BINDING_ID, channelId);
+ break;
+ }
+ return channelTypeUID;
+ }
+
/**
* Creates new channels for the thing.
*
private void createChannel(String channelId) {
ThingHandlerCallback callback = getCallback();
if (callback != null) {
- ChannelUID channelUID = new ChannelUID(thing.getUID(), channelId);
- ChannelTypeUID channelTypeUID = CHANNEL_BATTERY.equals(channelId)
- ? DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_BATTERY_LEVEL.getUID()
- : new ChannelTypeUID(BINDING_ID, channelId);
- Channel channel = callback.createChannelBuilder(channelUID, channelTypeUID).build();
+ final ChannelUID channelUID = new ChannelUID(thing.getUID(), channelId);
+ final ChannelTypeUID channelTypeUID = createChannelTypeUID(channelId);
+ final Channel channel = callback.createChannelBuilder(channelUID, channelTypeUID).build();
updateThing(editThing().withoutChannel(channelUID).withChannel(channel).build());
}
}
<label>Password</label>
<description>Password to access the FRITZ!Box.</description>
</parameter>
- <parameter name="pollingInterval" type="integer" min="5" max="60" unit="s" groupName="connection">
+ <parameter name="pollingInterval" type="integer" min="1" max="60" unit="s" groupName="connection">
<label>Polling Interval</label>
<description>Interval polling the FRITZ!Box (in seconds).</description>
<default>15</default>
<label>Password</label>
<description>Password to access the FRITZ!Powerline.</description>
</parameter>
- <parameter name="pollingInterval" type="integer" min="5" max="60" unit="s" groupName="connection">
+ <parameter name="pollingInterval" type="integer" min="1" max="60" unit="s" groupName="connection">
<label>Polling Interval</label>
<description>Interval polling the FRITZ!Powerline (in seconds).</description>
<default>15</default>
thing-type.avmfritz.Comet_DECT.label = Comet DECT
thing-type.avmfritz.Comet_DECT.description = Comet DECT heating thermostat.
+thing-type.avmfritz.Comet_DECT.channel.actual_temp.label = Current Temperature
+thing-type.avmfritz.Comet_DECT.channel.actual_temp.description = Current measured temperature.
thing-type.avmfritz.FRITZ_DECT_200.label = FRITZ!DECT 200
thing-type.avmfritz.FRITZ_DECT_200.description = FRITZ!DECT200 switchable outlet.
+thing-type.avmfritz.FRITZ_DECT_200.channel.energy.label = Energy Consumption
+thing-type.avmfritz.FRITZ_DECT_200.channel.energy.description = Accumulated energy consumption.
+thing-type.avmfritz.FRITZ_DECT_200.channel.power.label = Power
+thing-type.avmfritz.FRITZ_DECT_200.channel.power.description = Current power consumption.
thing-type.avmfritz.FRITZ_DECT_210.label = FRITZ!DECT 210
thing-type.avmfritz.FRITZ_DECT_210.description = FRITZ!DECT210 switchable outlet.
+thing-type.avmfritz.FRITZ_DECT_210.channel.energy.label = Energy Consumption
+thing-type.avmfritz.FRITZ_DECT_210.channel.energy.description = Accumulated energy consumption.
+thing-type.avmfritz.FRITZ_DECT_210.channel.power.label = Power
+thing-type.avmfritz.FRITZ_DECT_210.channel.power.description = Current power consumption.
thing-type.avmfritz.FRITZ_DECT_300.label = FRITZ!DECT 300
thing-type.avmfritz.FRITZ_DECT_300.description = FRITZ!DECT 300 heating thermostat.
+thing-type.avmfritz.FRITZ_DECT_300.channel.actual_temp.label = Current Temperature
+thing-type.avmfritz.FRITZ_DECT_300.channel.actual_temp.description = Current measured temperature.
thing-type.avmfritz.FRITZ_DECT_301.label = FRITZ!DECT 301
thing-type.avmfritz.FRITZ_DECT_301.description = FRITZ!DECT 301 heating thermostat.
+thing-type.avmfritz.FRITZ_DECT_301.channel.actual_temp.label = Current Temperature
+thing-type.avmfritz.FRITZ_DECT_301.channel.actual_temp.description = Current measured temperature.
thing-type.avmfritz.FRITZ_DECT_302.label = FRITZ!DECT 302
thing-type.avmfritz.FRITZ_DECT_302.description = FRITZ!DECT 302 heating thermostat.
+thing-type.avmfritz.FRITZ_DECT_302.channel.actual_temp.label = Current Temperature
+thing-type.avmfritz.FRITZ_DECT_302.channel.actual_temp.description = Current measured temperature.
thing-type.avmfritz.FRITZ_DECT_400.label = FRITZ!DECT 400
thing-type.avmfritz.FRITZ_DECT_400.description = FRITZ!DECT400 switch.
thing-type.avmfritz.FRITZ_DECT_400.channel.press.label = Button Press
thing-type.avmfritz.FRITZ_DECT_Repeater_100.description = FRITZ!DECT Repeater 100 DECT repeater.
thing-type.avmfritz.FRITZ_GROUP_HEATING.label = Heating Group
thing-type.avmfritz.FRITZ_GROUP_HEATING.description = Group for heating thermostats.
+thing-type.avmfritz.FRITZ_GROUP_HEATING.channel.actual_temp.label = Current Temperature
+thing-type.avmfritz.FRITZ_GROUP_HEATING.channel.actual_temp.description = Current measured temperature.
thing-type.avmfritz.FRITZ_GROUP_SWITCH.label = Switch Group
thing-type.avmfritz.FRITZ_GROUP_SWITCH.description = Group for switchable outlets and power meters.
+thing-type.avmfritz.FRITZ_GROUP_SWITCH.channel.energy.label = Energy Consumption
+thing-type.avmfritz.FRITZ_GROUP_SWITCH.channel.energy.description = Accumulated energy consumption.
+thing-type.avmfritz.FRITZ_GROUP_SWITCH.channel.power.label = Power
+thing-type.avmfritz.FRITZ_GROUP_SWITCH.channel.power.description = Current power consumption.
thing-type.avmfritz.FRITZ_Powerline_546E.label = FRITZ!Powerline 546E
thing-type.avmfritz.FRITZ_Powerline_546E.description = FRITZ!Powerline 546E with switchable outlet.
+thing-type.avmfritz.FRITZ_Powerline_546E.channel.energy.label = Energy Consumption
+thing-type.avmfritz.FRITZ_Powerline_546E.channel.energy.description = Accumulated energy consumption.
+thing-type.avmfritz.FRITZ_Powerline_546E.channel.power.label = Power
+thing-type.avmfritz.FRITZ_Powerline_546E.channel.power.description = Current power consumption.
thing-type.avmfritz.FRITZ_Powerline_546E_Solo.label = FRITZ!Powerline 546E
thing-type.avmfritz.FRITZ_Powerline_546E_Solo.description = A FRITZ!Powerline 546E with switchable outlet in stand-alone mode.
+thing-type.avmfritz.FRITZ_Powerline_546E_Solo.channel.energy.label = Energy Consumption
+thing-type.avmfritz.FRITZ_Powerline_546E_Solo.channel.energy.description = Accumulated energy consumption.
+thing-type.avmfritz.FRITZ_Powerline_546E_Solo.channel.power.label = Power
+thing-type.avmfritz.FRITZ_Powerline_546E_Solo.channel.power.description = Current power consumption.
thing-type.avmfritz.HAN_FUN_BLINDS.label = HAN-FUN Blinds
thing-type.avmfritz.HAN_FUN_BLINDS.description = HAN-FUN blinds (e.g. RolloTron DECT 1213)
thing-type.avmfritz.HAN_FUN_COLOR_BULB.label = HAN-FUN Color Light
channel-type.avmfritz.active_call.label = Active Call
channel-type.avmfritz.active_call.description = Details about active call.
-channel-type.avmfritz.actual_temp.label = Current Temperature
-channel-type.avmfritz.actual_temp.description = Current measured temperature.
channel-type.avmfritz.apply_template.label = Apply Template
channel-type.avmfritz.apply_template.description = Apply template for device(s).
channel-type.avmfritz.call_state.label = Call State
channel-type.avmfritz.comfort_temp.description = Thermostat Comfort temperature.
channel-type.avmfritz.contact_state.label = Contact State
channel-type.avmfritz.contact_state.description = Contact state information (OPEN/CLOSED).
-channel-type.avmfritz.obstruction_alarm.label = Obstruction Alarm
-channel-type.avmfritz.obstruction_alarm.description = Obstruction alarm of the blinds. The blinds were stopped and moved a bit in the opposite direction.
-channel-type.avmfritz.temperature_alarm.label = Temperature Alarm
-channel-type.avmfritz.temperature_alarm.description = Temperature alarm of the blinds. Indicates overheating of the motor.
channel-type.avmfritz.device_locked.label = Locked (manual)
channel-type.avmfritz.device_locked.description = Device is locked for switching by pressing the button on the device.
channel-type.avmfritz.eco_temp.label = Eco Temperature
channel-type.avmfritz.eco_temp.description = Thermostat Eco temperature.
-channel-type.avmfritz.energy.label = Energy Consumption
-channel-type.avmfritz.energy.description = Accumulated energy consumption.
channel-type.avmfritz.humidity.label = Current Humidity
channel-type.avmfritz.humidity.description = Current measured humidity.
channel-type.avmfritz.incoming_call.label = Incoming Call
channel-type.avmfritz.next_change.state.pattern = %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS
channel-type.avmfritz.next_temp.label = Next Setpoint Temperature
channel-type.avmfritz.next_temp.description = Next Setpoint Temperature.
+channel-type.avmfritz.obstruction_alarm.label = Obstruction Alarm
+channel-type.avmfritz.obstruction_alarm.description = Obstruction alarm of the blinds. The blinds were stopped and moved a bit in the opposite direction.
channel-type.avmfritz.outgoing_call.label = Outgoing Call
channel-type.avmfritz.outgoing_call.description = Details about outgoing call.
channel-type.avmfritz.outlet.label = Outlet
channel-type.avmfritz.outlet.description = Switched outlet (ON/OFF).
-channel-type.avmfritz.power.label = Power
-channel-type.avmfritz.power.description = Current power consumption.
channel-type.avmfritz.radiator_mode.label = Radiator Mode
channel-type.avmfritz.radiator_mode.description = States the mode of the radiator (ON/OFF/COMFORT/ECO/BOOST/WINDOW_OPEN).
channel-type.avmfritz.radiator_mode.state.option.ON = On
channel-type.avmfritz.set_temp.description = Thermostat Setpoint temperature.
channel-type.avmfritz.temperature.label = Current Temperature
channel-type.avmfritz.temperature.description = Current measured temperature.
-channel-type.avmfritz.voltage.label = Voltage
-channel-type.avmfritz.voltage.description = Current voltage.
+channel-type.avmfritz.temperature_alarm.label = Temperature Alarm
+channel-type.avmfritz.temperature_alarm.description = Temperature alarm of the blinds. Indicates overheating of the motor.
# channel types config
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
<channel id="apply_template" typeId="apply_template"/>
- <channel id="energy" typeId="energy"/>
- <channel id="power" typeId="power"/>
+ <channel id="energy" typeId="system.electrical-energy">
+ <label>Energy Consumption</label>
+ <description>Accumulated energy consumption.</description>
+ </channel>
+ <channel id="power" typeId="system.electric-power">
+ <label>Power</label>
+ <description>Current power consumption.</description>
+ </channel>
<channel id="outlet" typeId="outlet"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ipAddress</representation-property>
<config-description-ref uri="bridge-type:avmfritz:fritzpowerline"/>
<description>Details about incoming call.</description>
<state pattern="%1$s to %2$s" readOnly="true"/>
</channel-type>
+
<channel-type id="outgoing_call">
<item-type>Call</item-type>
<label>Outgoing Call</label>
<description>Details about outgoing call.</description>
<state pattern="%1$s to %2$s" readOnly="true"/>
</channel-type>
+
<channel-type id="active_call">
<item-type>Call</item-type>
<label>Active Call</label>
<description>Details about active call.</description>
<state pattern="%1$s" readOnly="true"/>
</channel-type>
+
<channel-type id="call_state">
<item-type>String</item-type>
<label>Call State</label>
</options>
</state>
</channel-type>
+
<channel-type id="apply_template" advanced="true">
<item-type>String</item-type>
<label>Apply Template</label>
<item-type>String</item-type>
<label>Mode</label>
<description>States the mode of the device (MANUAL/AUTOMATIC/VACATION).</description>
+ <category>Heating</category>
<state pattern="%s" readOnly="true">
<options>
<option value="MANUAL">Manual</option>
<label>Current Temperature</label>
<description>Current measured temperature.</description>
<category>Temperature</category>
+ <tags>
+ <tag>Measurement</tag>
+ <tag>Temperature</tag>
+ </tags>
<state pattern="%.1f %unit%" readOnly="true"/>
<config-description-ref uri="channel-type:avmfritz:temperature"/>
<label>Current Humidity</label>
<description>Current measured humidity.</description>
<category>Humidity</category>
+ <tags>
+ <tag>Measurement</tag>
+ <tag>Humidity</tag>
+ </tags>
<state pattern="%.0f %unit%" readOnly="true"/>
</channel-type>
- <channel-type id="energy">
- <item-type>Number:Energy</item-type>
- <label>Energy Consumption</label>
- <description>Accumulated energy consumption.</description>
- <category>Energy</category>
- <state pattern="%.3f kWh" readOnly="true"/>
- </channel-type>
-
- <channel-type id="power">
- <item-type>Number:Power</item-type>
- <label>Power</label>
- <description>Current power consumption.</description>
- <category>Energy</category>
- <state pattern="%.2f %unit%" readOnly="true"/>
- </channel-type>
-
- <channel-type id="voltage">
- <item-type>Number:ElectricPotential</item-type>
- <label>Voltage</label>
- <description>Current voltage.</description>
- <category>Energy</category>
- <state pattern="%.1f %unit%" readOnly="true"/>
- </channel-type>
-
<channel-type id="outlet">
<item-type>Switch</item-type>
<label>Outlet</label>
<description>Switched outlet (ON/OFF).</description>
<category>PowerOutlet</category>
- </channel-type>
-
- <channel-type id="actual_temp" advanced="true">
- <item-type>Number:Temperature</item-type>
- <label>Current Temperature</label>
- <description>Current measured temperature.</description>
- <category>Temperature</category>
- <state pattern="%.1f %unit%" readOnly="true"/>
+ <tags>
+ <tag>Switch</tag>
+ <tag>Power</tag>
+ </tags>
</channel-type>
<channel-type id="set_temp">
<label>Setpoint Temperature</label>
<description>Thermostat Setpoint temperature.</description>
<category>Heating</category>
+ <tags>
+ <tag>Setpoint</tag>
+ <tag>Temperature</tag>
+ </tags>
<state pattern="%.1f %unit%"/>
</channel-type>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
<channel id="temperature" typeId="temperature"/>
- <channel id="actual_temp" typeId="actual_temp"/>
+ <channel id="actual_temp" typeId="system.indoor-temperature">
+ <label>Current Temperature</label>
+ <description>Current measured temperature.</description>
+ </channel>
<channel id="set_temp" typeId="set_temp"/>
<channel id="eco_temp" typeId="eco_temp"/>
<channel id="comfort_temp" typeId="comfort_temp"/>
<channel id="battery_low" typeId="system.low-battery"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
<channel id="temperature" typeId="temperature"/>
- <channel id="actual_temp" typeId="actual_temp"/>
+ <channel id="actual_temp" typeId="system.indoor-temperature">
+ <label>Current Temperature</label>
+ <description>Current measured temperature.</description>
+ </channel>
<channel id="set_temp" typeId="set_temp"/>
<channel id="eco_temp" typeId="eco_temp"/>
<channel id="comfort_temp" typeId="comfort_temp"/>
<channel id="battery_low" typeId="system.low-battery"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
<channel id="temperature" typeId="temperature"/>
- <channel id="actual_temp" typeId="actual_temp"/>
+ <channel id="actual_temp" typeId="system.indoor-temperature">
+ <label>Current Temperature</label>
+ <description>Current measured temperature.</description>
+ </channel>
<channel id="set_temp" typeId="set_temp"/>
<channel id="eco_temp" typeId="eco_temp"/>
<channel id="comfort_temp" typeId="comfort_temp"/>
<channel id="battery_low" typeId="system.low-battery"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
<channel id="temperature" typeId="temperature"/>
- <channel id="actual_temp" typeId="actual_temp"/>
+ <channel id="actual_temp" typeId="system.indoor-temperature">
+ <label>Current Temperature</label>
+ <description>Current measured temperature.</description>
+ </channel>
<channel id="set_temp" typeId="set_temp"/>
<channel id="eco_temp" typeId="eco_temp"/>
<channel id="comfort_temp" typeId="comfort_temp"/>
<channel id="battery_low" typeId="system.low-battery"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
<channel id="temperature" typeId="temperature"/>
- <channel id="energy" typeId="energy"/>
- <channel id="power" typeId="power"/>
+ <channel id="energy" typeId="system.electrical-energy">
+ <label>Energy Consumption</label>
+ <description>Accumulated energy consumption.</description>
+ </channel>
+ <channel id="power" typeId="system.electric-power">
+ <label>Power</label>
+ <description>Current power consumption.</description>
+ </channel>
<channel id="outlet" typeId="outlet"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
<channel id="temperature" typeId="temperature"/>
- <channel id="energy" typeId="energy"/>
- <channel id="power" typeId="power"/>
+ <channel id="energy" typeId="system.electrical-energy">
+ <label>Energy Consumption</label>
+ <description>Accumulated energy consumption.</description>
+ </channel>
+ <channel id="power" typeId="system.electric-power">
+ <label>Power</label>
+ <description>Current power consumption.</description>
+ </channel>
<channel id="outlet" typeId="outlet"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
<channel id="mode" typeId="mode"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
- <channel id="energy" typeId="energy"/>
- <channel id="power" typeId="power"/>
+ <channel id="energy" typeId="system.electrical-energy">
+ <label>Energy Consumption</label>
+ <description>Accumulated energy consumption.</description>
+ </channel>
+ <channel id="power" typeId="system.electric-power">
+ <label>Power</label>
+ <description>Current power consumption.</description>
+ </channel>
<channel id="outlet" typeId="outlet"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzdevice"/>
<channel id="mode" typeId="mode"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
- <channel id="actual_temp" typeId="actual_temp"/>
+ <channel id="actual_temp" typeId="system.indoor-temperature">
+ <label>Current Temperature</label>
+ <description>Current measured temperature.</description>
+ </channel>
<channel id="set_temp" typeId="set_temp"/>
<channel id="eco_temp" typeId="eco_temp"/>
<channel id="comfort_temp" typeId="comfort_temp"/>
<channel id="battery_low" typeId="system.low-battery"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzgroup"/>
<channel id="mode" typeId="mode"/>
<channel id="locked" typeId="locked"/>
<channel id="device_locked" typeId="device_locked"/>
- <channel id="energy" typeId="energy"/>
- <channel id="power" typeId="power"/>
+ <channel id="energy" typeId="system.electrical-energy">
+ <label>Energy Consumption</label>
+ <description>Accumulated energy consumption.</description>
+ </channel>
+ <channel id="power" typeId="system.electric-power">
+ <label>Power</label>
+ <description>Current power consumption.</description>
+ </channel>
<channel id="outlet" typeId="outlet"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>ain</representation-property>
<config-description-ref uri="thing-type:avmfritz:fritzgroup"/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
+ xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
+
+ <thing-type uid="avmfritz:FRITZ_Powerline_546E_Solo">
+ <instruction-set targetVersion="1">
+ <update-channel id="energy">
+ <type>system:electrical-energy</type>
+ </update-channel>
+ <update-channel id="power">
+ <type>system:electrical-power</type>
+ </update-channel>
+ <update-channel id="voltage">
+ <type>system:electrical-voltage</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_DECT_210">
+ <instruction-set targetVersion="1">
+ <update-channel id="energy">
+ <type>system:electrical-energy</type>
+ </update-channel>
+ <update-channel id="power">
+ <type>system:electrical-power</type>
+ </update-channel>
+ <update-channel id="voltage">
+ <type>system:electrical-voltage</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_DECT_200">
+ <instruction-set targetVersion="1">
+ <update-channel id="energy">
+ <type>system:electrical-energy</type>
+ </update-channel>
+ <update-channel id="power">
+ <type>system:electrical-power</type>
+ </update-channel>
+ <update-channel id="voltage">
+ <type>system:electrical-voltage</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_Powerline_546E">
+ <instruction-set targetVersion="1">
+ <update-channel id="energy">
+ <type>system:electrical-energy</type>
+ </update-channel>
+ <update-channel id="power">
+ <type>system:electrical-power</type>
+ </update-channel>
+ <update-channel id="voltage">
+ <type>system:electrical-voltage</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:Comet_DECT">
+ <instruction-set targetVersion="1">
+ <update-channel id="actual_temp">
+ <type>system:indoor-temperature</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_DECT_302">
+ <instruction-set targetVersion="1">
+ <update-channel id="actual_temp">
+ <type>system:indoor-temperature</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_DECT_301">
+ <instruction-set targetVersion="1">
+ <update-channel id="actual_temp">
+ <type>system:indoor-temperature</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_DECT_300">
+ <instruction-set targetVersion="1">
+ <update-channel id="actual_temp">
+ <type>system:indoor-temperature</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_GROUP_HEATING">
+ <instruction-set targetVersion="1">
+ <update-channel id="actual_temp">
+ <type>system:indoor-temperature</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="avmfritz:FRITZ_GROUP_SWITCH">
+ <instruction-set targetVersion="1">
+ <update-channel id="energy">
+ <type>system:electrical-energy</type>
+ </update-channel>
+ <update-channel id="power">
+ <type>system:electrical-power</type>
+ </update-channel>
+ <update-channel id="voltage">
+ <type>system:electrical-voltage</type>
+ </update-channel>
+ </instruction-set>
+ </thing-type>
+
+</update:update-descriptions>
import static org.junit.jupiter.api.Assertions.assertThrows;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
* @author Christoph Weitkamp - Initial contribution
*/
@ExtendWith(MockitoExtension.class)
+@NonNullByDefault
public class AVMFritzHeatingActionsTest {
private final ThingActions thingActionsStub = new ThingActions() {
}
@Override
- public ThingHandler getThingHandler() {
+ public @Nullable ThingHandler getThingHandler() {
return null;
}
};
- private @Mock AVMFritzHeatingActionsHandler heatingActionsHandler;
+ private @Mock @NonNullByDefault({}) AVMFritzHeatingActionsHandler heatingActionsHandlerMock;
- private AVMFritzHeatingActions heatingActions;
+ private @NonNullByDefault({}) AVMFritzHeatingActions heatingActions;
@BeforeEach
public void setUp() {
@Test
public void testSetBoostModeDurationNull() {
- heatingActions.setThingHandler(heatingActionsHandler);
+ heatingActions.setThingHandler(heatingActionsHandlerMock);
assertThrows(IllegalArgumentException.class, () -> AVMFritzHeatingActions.setBoostMode(heatingActions, null));
}
@Test
public void testSetBoostMode() {
- heatingActions.setThingHandler(heatingActionsHandler);
+ heatingActions.setThingHandler(heatingActionsHandlerMock);
AVMFritzHeatingActions.setBoostMode(heatingActions, Long.valueOf(5L));
}
@Test
public void testSetWindowOpenModeDurationNull() {
- heatingActions.setThingHandler(heatingActionsHandler);
+ heatingActions.setThingHandler(heatingActionsHandlerMock);
assertThrows(IllegalArgumentException.class,
() -> AVMFritzHeatingActions.setWindowOpenMode(heatingActions, null));
}
@Test
public void testSetWindowOpenMode() {
- heatingActions.setThingHandler(heatingActionsHandler);
+ heatingActions.setThingHandler(heatingActionsHandlerMock);
AVMFritzHeatingActions.setWindowOpenMode(heatingActions, Long.valueOf(5L));
}
}