1 #pragma once 2 3 #include "DomoticzHardware.h" 4 5 namespace Json 6 { 7 class Value; 8 }; 9 10 class CEcoCompteur : public CDomoticzHardwareBase 11 { 12 public: 13 CEcoCompteur(const int ID, const std::string& url, const unsigned short port); 14 ~CEcoCompteur(void); 15 bool WriteToHardware(const char *pdata, const unsigned char length) override; 16 private: 17 void Init(); 18 bool StartHardware() override; 19 bool StopHardware() override; 20 void Do_Work(); 21 void GetScript(); 22 private: 23 std::string m_url; 24 unsigned short m_port; 25 unsigned short m_refresh; 26 std::shared_ptr<std::thread> m_thread; 27 }; 28 29