/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) 2019 Bernhard Trinnes . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef DEVICEPLUGINCOINMARKETCAP_H #define DEVICEPLUGINCOINMARKETCAP_H #include "devices/deviceplugin.h" #include "devices/devicemanager.h" #include "plugintimer.h" #include #include class DevicePluginCoinMarketCap : public DevicePlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "deviceplugincoinmarketcap.json") Q_INTERFACES(DevicePlugin) public: explicit DevicePluginCoinMarketCap(); void setupDevice(DeviceSetupInfo *info) override; void deviceRemoved(Device *device) override; private: PluginTimer *m_pluginTimer = nullptr; QHash m_priceRequests; QHash m_httpRequests; void getPriceCall(Device *device); private slots: void onPluginTimer(); void onPriceCallFinished(); }; #endif // DEVICEPLUGINCOINMARKETCAP_H