BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
BeeWiSmartLite.h
1 #pragma once
2 
3 #include <Poco/SharedPtr.h>
4 #include <Poco/UUID.h>
5 
6 #include "bluetooth/BeeWiDevice.h"
7 
8 namespace BeeeOn {
9 
14 class BeeWiSmartLite : public BeeWiDevice {
15 public:
16  typedef Poco::SharedPtr<BeeWiSmartLite> Ptr;
17 
18  static const std::string NAME;
19 
20 private:
24  static const Poco::UUID ACTUAL_VALUES;
28  static const Poco::UUID WRITE_VALUES;
29 
30 public:
31  enum Command {
32  ON_OFF = 0x10,
33  COLOR_TEMPERATURE = 0x11,
34  BRIGHTNESS = 0x12,
35  COLOR = 0x13
36  };
37 
39  const MACAddress& address,
40  const Poco::Timespan& timeout,
41  const RefreshTime& refresh,
42  const HciInterface::Ptr hci);
43  ~BeeWiSmartLite();
44 
45  void requestModifyState(
46  const ModuleID& moduleID,
47  const double value) override;
48 
55  const std::vector<unsigned char>& data) const override;
56 
57  static bool match(const std::string& modelID);
58 
59 protected:
60  unsigned int brightnessToPercentages(const double value) const;
61  unsigned char brightnessFromPercentages(const double percents) const;
62 
63  unsigned int colorTempToKelvins(const double value) const;
64  unsigned char colorTempFromKelvins(const double temperature) const;
65 };
66 
67 }
The class represents BeeWi smart led light. It allows to gather and to control all its modules...
Definition: BeeWiSmartLite.h:14
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
void requestModifyState(const ModuleID &moduleID, const double value) override
Modifies the device module given by moduleID to a given value.
Definition: BeeWiSmartLite.cpp:50
Definition: SensorData.h:20
Definition: MACAddress.h:8
Abstract class for BeeWi devices. Some BeeWi devices need to set the time to stop blinking...
Definition: BeeWiDevice.h:22
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: BLESmartDevice.cpp:31
Definition: ModuleID.h:12
SensorData parseAdvertisingData(const std::vector< unsigned char > &data) const override
Definition: BeeWiSmartLite.cpp:100