mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-14 22:35:49 +00:00
correct subscription processing
This commit is contained in:
@ -67,7 +67,6 @@ void ExtSysMonSensor::update()
|
||||
continue; // skip properties which are not explicitly subscribed
|
||||
|
||||
auto value = m_source->data(source);
|
||||
qCWarning(LOG_ESS) << source << value;
|
||||
property->setValue(value);
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ NetworkSource::~NetworkSource()
|
||||
|
||||
QVariant NetworkSource::data(const QString &_source)
|
||||
{
|
||||
qCWarning(LOG_ESS) << "Source" << _source;
|
||||
qCDebug(LOG_ESS) << "Source" << _source;
|
||||
|
||||
if (!m_values.contains(_source))
|
||||
run();
|
||||
@ -82,7 +82,9 @@ KSysGuard::SensorInfo *NetworkSource::initialData(const QString &_source) const
|
||||
void NetworkSource::run()
|
||||
{
|
||||
m_values["device"] = NetworkSource::getCurrentDevice();
|
||||
m_process->start("iwgetid", {"-r"});
|
||||
if (m_process->state() == QProcess::ProcessState::NotRunning) {
|
||||
m_process->start("iwgetid", {"-r"});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,12 +49,10 @@ QVariant WeatherSource::data(const QString &_source)
|
||||
|
||||
int ind = index(_source);
|
||||
if (!m_values.contains(_source)) {
|
||||
QVariantHash data = m_extWeather->itemByTagNumber(ind)->run();
|
||||
for (auto &key : data.keys())
|
||||
m_values[key] = data[key];
|
||||
auto data = m_extWeather->itemByTagNumber(ind)->run();
|
||||
m_values.insert(data);
|
||||
}
|
||||
QVariant value = m_values.take(_source);
|
||||
return value;
|
||||
return m_values.take(_source);
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +92,7 @@ KSysGuard::SensorInfo *WeatherSource::initialData(const QString &_source) const
|
||||
data->unit = KSysGuard::UnitCelsius;
|
||||
} else if (_source.startsWith("timestamp")) {
|
||||
data->name = QString("Timestamp for '%1'").arg(m_extWeather->itemByTagNumber(ind)->uniq());
|
||||
data->variantType = QVariant::String;
|
||||
data->variantType = QVariant::DateTime;
|
||||
data->unit = KSysGuard::UnitNone;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user