BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
BelkinWemoBulb.h
1 #pragma once
2 
3 #include <list>
4 #include <string>
5 
6 #include <Poco/Mutex.h>
7 #include <Poco/SharedPtr.h>
8 
9 #include "belkin/BelkinWemoDevice.h"
10 #include "belkin/BelkinWemoLink.h"
11 #include "model/ModuleID.h"
12 #include "model/ModuleType.h"
13 #include "model/SensorData.h"
14 
15 namespace BeeeOn {
16 
23 public:
24  typedef Poco::SharedPtr<BelkinWemoBulb> Ptr;
25 
31  const BelkinWemoLink::BulbID bulbId,
32  const BelkinWemoLink::Ptr link,
33  const RefreshTime &refresh);
34  ~BelkinWemoBulb();
35 
36  bool requestModifyState(const ModuleID& moduleID, const double value) override;
37  SensorData requestState() override;
38 
39  std::list<ModuleType> moduleTypes() const override;
40  std::string name() const override;
41  Poco::FastMutex& lock() override;
42 
43  BelkinWemoLink::Ptr link() const;
44 
45 private:
46  static DeviceID buildDeviceID(const BelkinWemoLink::BulbID &id);
47  int dimToPercentage(const double value);
48  int dimFromPercentage(const double percents);
49 
50 private:
51  BelkinWemoLink::BulbID m_bulbId;
52  BelkinWemoLink::Ptr m_link;
53 };
54 
55 }
Abstract class representing generic BelkinWemo device.
Definition: BelkinWemoDevice.h:24
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
BelkinWemoBulb(const BelkinWemoLink::BulbID bulbId, const BelkinWemoLink::Ptr link, const RefreshTime &refresh)
The DeviceID is created based on a bulb&#39;s 64-bit identifier, where DevicePrefix is given on 8th byte...
Definition: BelkinWemoBulb.cpp:35
Definition: SensorData.h:20
Definition: ModuleID.h:12
The class represents Belkin WeMo Led Light Bulb. It works with Belkin WeMo Link it uses his methods t...
Definition: BelkinWemoBulb.h:22
Definition: DeviceID.h:17
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: BelkinWemoDevice.cpp:30