supla-device
Loading...
Searching...
No Matches
virtual_channel.h
1/*
2 Copyright (C) AC SOFTWARE SP. Z O.O
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#ifndef SRC_SUPLA_SUPLET_VIRTUAL_CHANNEL_H_
20#define SRC_SUPLA_SUPLET_VIRTUAL_CHANNEL_H_
21
22#include <supla/control/virtual_relay.h>
23#include <supla/sensor/virtual_binary.h>
24#include <supla/sensor/virtual_thermometer.h>
25
26namespace Supla {
27namespace Suplet {
28
29class VirtualRelay : public Supla::Control::VirtualRelay {
30 public:
31 VirtualRelay(uint8_t subDeviceId,
32 int channelNumber,
33 _supla_int_t functions =
34 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
35
36 bool isOwnerOfSubDeviceId(int subDeviceId) const override;
37
38 private:
39 uint8_t subDeviceId = 0;
40};
41
42class VirtualBinarySensor : public Supla::Sensor::VirtualBinary {
43 public:
44 VirtualBinarySensor(uint8_t subDeviceId,
45 int channelNumber,
46 bool keepStateInStorage = false);
47
48 bool isOwnerOfSubDeviceId(int subDeviceId) const override;
49
50 private:
51 uint8_t subDeviceId = 0;
52};
53
54class VirtualThermometer : public Supla::Sensor::VirtualThermometer {
55 public:
56 VirtualThermometer(uint8_t subDeviceId, int channelNumber);
57
58 bool isOwnerOfSubDeviceId(int subDeviceId) const override;
59
60 private:
61 uint8_t subDeviceId = 0;
62};
63
64} // namespace Suplet
65} // namespace Supla
66
67#endif // SRC_SUPLA_SUPLET_VIRTUAL_CHANNEL_H_
Definition virtual_relay.h:26
Virtual binary sensor with explicit logical state control.
Definition virtual_binary.h:36
Definition virtual_thermometer.h:26
bool isOwnerOfSubDeviceId(int subDeviceId) const override
Returns true if element is owner of subDeviceId.
bool isOwnerOfSubDeviceId(int subDeviceId) const override
Returns true if element is owner of subDeviceId.
bool isOwnerOfSubDeviceId(int subDeviceId) const override
Returns true if element is owner of subDeviceId.