This commit is contained in:
Thomas Peterson 2026-02-11 12:21:42 +01:00
parent 519b095d16
commit 8108a83fe2
10 changed files with 43 additions and 14 deletions

View File

@ -59,7 +59,9 @@ bool HistoryStore::isNumericSource(TextSource source) {
source == TextSource::KNX_DPT_PERCENT ||
source == TextSource::KNX_DPT_POWER ||
source == TextSource::KNX_DPT_ENERGY ||
source == TextSource::KNX_DPT_DECIMALFACTOR;
source == TextSource::KNX_DPT_DECIMALFACTOR ||
source == TextSource::KNX_DPT_HUMIDITY ||
source == TextSource::KNX_DPT_LUX;
}
bool HistoryStore::keysEqual(const SeriesKey& a, const SeriesKey& b) {

View File

@ -153,6 +153,18 @@ void KnxWorker::init() {
TextSource::KNX_DPT_ENERGY);
}
KNXValue humidityValue = 0.0f;
if (go.tryValue(humidityValue, DPT_Value_Humidity)) {
WidgetManager::instance().onKnxValue(groupAddr, static_cast<float>(humidityValue),
TextSource::KNX_DPT_HUMIDITY);
}
KNXValue luxValue = 0.0f;
if (go.tryValue(luxValue, DPT_Value_Lux)) {
WidgetManager::instance().onKnxValue(groupAddr, static_cast<float>(luxValue),
TextSource::KNX_DPT_LUX);
}
struct tm timeTm = {};
KNXValue timeValue(timeTm);
if (go.tryValue(timeValue, DPT_TimeOfDay)) {

View File

@ -57,6 +57,7 @@ enum class ButtonAction : uint8_t {
KNX = 0,
JUMP = 1,
BACK = 2,
NONE = 3,
};
enum class ChartPeriod : uint8_t {
@ -84,6 +85,8 @@ enum class TextSource : uint8_t {
SYSTEM_TIME = 11, // System Time (RTC)
SYSTEM_DATE = 12, // System Date (RTC)
SYSTEM_DATETIME = 13, // System DateTime (RTC)
KNX_DPT_HUMIDITY = 14, // KNX Humidity (DPT 9.007)
KNX_DPT_LUX = 15, // KNX Lux (DPT 9.004)
};
enum class TextAlign : uint8_t {

View File

@ -174,6 +174,8 @@ void ArcWidget::onKnxValue(float value) {
case TextSource::KNX_DPT_POWER:
case TextSource::KNX_DPT_ENERGY:
case TextSource::KNX_DPT_DECIMALFACTOR:
case TextSource::KNX_DPT_HUMIDITY:
case TextSource::KNX_DPT_LUX:
lastValue_ = value;
lv_arc_set_value(obj_, clampToRange(value, config_.arcMin, config_.arcMax));
updateValueLabel(value);

View File

@ -243,7 +243,9 @@ void LabelWidget::onKnxValue(float value) {
config_.textSource != TextSource::KNX_DPT_PERCENT &&
config_.textSource != TextSource::KNX_DPT_POWER &&
config_.textSource != TextSource::KNX_DPT_ENERGY &&
config_.textSource != TextSource::KNX_DPT_DECIMALFACTOR) {
config_.textSource != TextSource::KNX_DPT_DECIMALFACTOR &&
config_.textSource != TextSource::KNX_DPT_HUMIDITY &&
config_.textSource != TextSource::KNX_DPT_LUX) {
return;
}

View File

@ -256,7 +256,9 @@ void PowerLinkWidget::onKnxValue(float value) {
config_.textSource != TextSource::KNX_DPT_PERCENT &&
config_.textSource != TextSource::KNX_DPT_POWER &&
config_.textSource != TextSource::KNX_DPT_ENERGY &&
config_.textSource != TextSource::KNX_DPT_DECIMALFACTOR) return;
config_.textSource != TextSource::KNX_DPT_DECIMALFACTOR &&
config_.textSource != TextSource::KNX_DPT_HUMIDITY &&
config_.textSource != TextSource::KNX_DPT_LUX) return;
float factor = parseFloatOr(config_.text, 1.0f);
float speed = std::fabs(value) * factor;

View File

@ -289,7 +289,9 @@ static bool isNumericSource(TextSource source) {
source == TextSource::KNX_DPT_PERCENT ||
source == TextSource::KNX_DPT_POWER ||
source == TextSource::KNX_DPT_ENERGY ||
source == TextSource::KNX_DPT_DECIMALFACTOR;
source == TextSource::KNX_DPT_DECIMALFACTOR ||
source == TextSource::KNX_DPT_HUMIDITY ||
source == TextSource::KNX_DPT_LUX;
}
static void formatValue(char* buf, size_t bufSize, float value, const char* fmt, TextSource source) {

View File

@ -34,7 +34,7 @@
<template v-else>
<div class="absolute inset-0 overflow-hidden" :style="roomCardTileContainerStyle">
<!-- Room name (top-left) -->
<div class="absolute" :style="{ left: '16px', top: '12px', color: widget.textColor, fontSize: fontSizes[widget.fontSize || 2] + 'px', fontWeight: 600 }">
<div class="absolute" :style="{ left: (16 * scale) + 'px', top: (12 * scale) + 'px', color: widget.textColor, fontSize: (fontSizes[widget.fontSize || 2] * scale) + 'px', fontWeight: 600 }">
{{ roomCardParts.name }}
</div>
<!-- Text Lines -->

View File

@ -24,6 +24,7 @@
</template>
<div :class="rowClass"><label :class="labelClass">Klick-Aktion</label>
<select :class="inputClass" v-model.number="widget.action">
<option :value="BUTTON_ACTIONS.NONE">Keine</option>
<option :value="BUTTON_ACTIONS.JUMP">Sprung</option>
<option :value="BUTTON_ACTIONS.BACK">Zurueck</option>
</select>

View File

@ -30,7 +30,8 @@ export const ICON_POSITIONS = {
export const BUTTON_ACTIONS = {
KNX: 0,
JUMP: 1,
BACK: 2
BACK: 2,
NONE: 3
};
export const TEXT_ALIGNS = {
@ -90,7 +91,9 @@ export const textSources = {
10: 'KNX Datum & Uhrzeit (DPT 19.001)',
11: 'System Uhrzeit',
12: 'System Datum',
13: 'System Datum & Uhrzeit'
13: 'System Datum & Uhrzeit',
14: 'KNX Luftfeuchtigkeit (DPT 9.007)',
15: 'KNX Helligkeit (DPT 9.004)'
};
export const textSourceGroups = [
@ -98,7 +101,7 @@ export const textSourceGroups = [
{ label: 'System', values: [11, 12, 13] },
{ label: 'DPT 1.x', values: [2] },
{ label: 'DPT 5.x', values: [3, 7] },
{ label: 'DPT 9.x', values: [1] },
{ label: 'DPT 9.x', values: [1, 14, 15] },
{ label: 'DPT 10.x', values: [8] },
{ label: 'DPT 11.x', values: [9] },
{ label: 'DPT 13.x', values: [6] },
@ -108,17 +111,17 @@ export const textSourceGroups = [
];
export const sourceOptions = {
label: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
label: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
button: [0],
led: [0, 2],
icon: [0, 2],
powernode: [0, 1, 2, 3, 4, 5, 6, 7],
powerlink: [0, 1, 3, 5, 6, 7],
chart: [1, 3, 5, 6, 7],
powernode: [0, 1, 2, 3, 4, 5, 6, 7, 14, 15],
powerlink: [0, 1, 3, 5, 6, 7, 14, 15],
chart: [1, 3, 5, 6, 7, 14, 15],
clock: [11],
roomcard: [0, 1, 3, 5, 6, 7], // Temperature sources
roomcard: [0, 1, 3, 5, 6, 7, 14, 15],
rectangle: [0],
arc: [0, 1, 2, 3, 5, 6, 7],
arc: [0, 1, 2, 3, 5, 6, 7, 14, 15],
buttonmatrix: [0]
};