BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
BelkinWemoSwitch.h
1 #pragma once
2 
3 #include <list>
4 #include <string>
5 
6 #include <Poco/Net/SocketAddress.h>
7 #include <Poco/SharedPtr.h>
8 #include <Poco/Timespan.h>
9 
10 #include "belkin/BelkinWemoStandaloneDevice.h"
11 #include "model/ModuleType.h"
12 #include "model/SensorData.h"
13 
14 namespace BeeeOn {
15 
21 public:
22  typedef Poco::SharedPtr<BelkinWemoSwitch> Ptr;
23 
31  const Poco::Net::SocketAddress& address,
32  const Poco::Timespan &httpTimeout,
33  const RefreshTime &refresh);
34 
36 
40  bool requestModifyState(const ModuleID& moduleID, const double value) override;
41 
50  SensorData requestState() override;
51 
52  std::list<ModuleType> moduleTypes() const override;
53  std::string name() const override;
54 
58  bool operator==(const BelkinWemoSwitch& bws) const;
59 };
60 
61 }
bool operator==(const BelkinWemoSwitch &bws) const
It compares two switches based on DeviceID.
Definition: BelkinWemoSwitch.cpp:85
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
Definition: SensorData.h:20
bool requestModifyState(const ModuleID &moduleID, const double value) override
It sets the switch to the given state.
Definition: BelkinWemoSwitch.cpp:38
The class represents Belkin WeMo Switch F7C027fr. Provides functions to control the switch...
Definition: BelkinWemoSwitch.h:20
SensorData requestState() override
Prepares SOAP message containing request state command and sends it to device via HTTP...
Definition: BelkinWemoSwitch.cpp:49
Definition: ModuleID.h:12
BelkinWemoSwitch(const Poco::Net::SocketAddress &address, const Poco::Timespan &httpTimeout, const RefreshTime &refresh)
Creates belkin wemo switch. If the device is not on network throws Poco::TimeoutException also in thi...
Definition: BelkinWemoSwitch.cpp:23
Abstract class representing generic BelkinWemo standalone device. The class implements sending messag...
Definition: BelkinWemoStandaloneDevice.h:20
RefreshTime refresh() const override
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
Definition: BelkinWemoDevice.cpp:30