QortalOS Brooklyn for Raspberry Pi 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
794 B

/*
SPDX-FileCopyrightText: 2007 Petri Damsten <[email protected]>
SPDX-FileCopyrightText: 2007 Christopher Blauvelt <[email protected]>
SPDX-License-Identifier: LGPL-2.0-only
*/
#pragma once
#include <QMap>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QTimer>
#include <QVariant>
class HddTemp : public QObject
{
Q_OBJECT
public:
enum DataType {
Temperature = 0,
Unit,
};
explicit HddTemp(QObject *parent = nullptr);
~HddTemp() override;
QStringList sources();
QVariant data(const QString source, const DataType type) const;
protected:
void timerEvent(QTimerEvent *event) override;
private:
int m_failCount;
bool m_cacheValid;
QMap<QString, QList<QVariant>> m_data;
bool updateData();
};