/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright (C) 2019 Bernhard Trinnes . *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DEVICEPLUGINLUKEROBERTS_H
#define DEVICEPLUGINLUKEROBERTS_H
#include "plugintimer.h"
#include "devices/deviceplugin.h"
#include "hardware/bluetoothlowenergy/bluetoothlowenergydevice.h"
#include "lukeroberts.h"
class DevicePluginLukeRoberts : public DevicePlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "devicepluginlukeroberts.json")
Q_INTERFACES(DevicePlugin)
public:
explicit DevicePluginLukeRoberts();
void init() override;
void discoverDevices(DeviceDiscoveryInfo *info) override;
void setupDevice(DeviceSetupInfo *info) override;
void postSetupDevice(Device *device) override;
void executeAction(DeviceActionInfo *info) override;
void deviceRemoved(Device *device) override;
private:
QHash m_lamps;
PluginTimer *m_reconnectTimer = nullptr;
bool m_autoSymbolMode = true;
private slots:
void onPluginConfigurationChanged(const ParamTypeId ¶mTypeId, const QVariant &value);
void onReconnectTimeout();
void onConnectedChanged(bool connected);
void onStatusCodeReceived(LukeRoberts::StatusCodes statusCode);
void onDeviceInformationChanged(const QString &firmwareRevision, const QString &hardwareRevision, const QString &softwareRevision);
};
#endif // DEVICEPLUGINLUKEROBERTS_H