6 #include <Poco/Mutex.h>
7 #include <Poco/SharedPtr.h>
9 #include "core/PollableDevice.h"
10 #include "model/DeviceID.h"
11 #include "model/ModuleID.h"
12 #include "model/ModuleType.h"
13 #include "model/SensorData.h"
14 #include "philips/PhilipsHueBulbInfo.h"
15 #include "philips/PhilipsHueBridge.h"
16 #include "util/Loggable.h"
25 typedef Poco::SharedPtr<PhilipsHueBulb> Ptr;
27 static const double MAX_DIM;
34 const uint32_t ordinalNumber,
35 const PhilipsHueBridge::BulbID bulbId,
36 const PhilipsHueBridge::Ptr bridge,
40 virtual bool requestModifyState(
const ModuleID& moduleID,
const double value) = 0;
45 virtual std::list<ModuleType> moduleTypes()
const = 0;
46 virtual std::string name()
const = 0;
47 Poco::FastMutex& lock();
49 PhilipsHueBridge::Ptr bridge();
52 void poll(Distributor::Ptr distributor)
override;
55 int dimToPercentage(
const double value);
56 int dimFromPercentage(
const double percents);
60 uint32_t m_ordinalNumber;
61 PhilipsHueBridge::Ptr m_bridge;
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
Definition: SensorData.h:20
void poll(Distributor::Ptr distributor) override
Perform polling for data and ship them via the given distributor.
Definition: PhilipsHueBulb.cpp:63
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: PhilipsHueBulb.cpp:42
Definition: ModuleID.h:12
Definition: Loggable.h:19
DeviceID id() const override
Definition: PhilipsHueBulb.cpp:37
Abstract class representing generic Philips Hue bulb.
Definition: PhilipsHueBulb.h:23
Definition: DeviceID.h:17
PollableDevice is a device that is necessary to poll regularly for data. The polling can take some ti...
Definition: PollableDevice.h:18
Definition: PhilipsHueBulbInfo.h:11
PhilipsHueBulb(const uint32_t ordinalNumber, const PhilipsHueBridge::BulbID bulbId, const PhilipsHueBridge::Ptr bridge, const RefreshTime &refresh)
The DeviceID is created based on a bulb's 64-bit identifier, where DevicePrefix is given on 8th byte...
Definition: PhilipsHueBulb.cpp:14