supla-device
Loading...
Searching...
No Matches
distance.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_SENSOR_DISTANCE_H_
5#define SRC_SUPLA_SENSOR_DISTANCE_H_
6
7#include "supla/channel_element.h"
8
9#define DISTANCE_NOT_AVAILABLE -1.0
10
11namespace Supla {
12namespace Sensor {
13class Distance : public ChannelElement {
14 public:
15 Distance();
16
17 virtual double getValue();
18 virtual void setReadIntervalMs(uint32_t timeMs);
19
20 void iterateAlways() override;
21
22 protected:
23 uint32_t lastReadTime = 0;
24 uint32_t readIntervalMs = 100;
25};
26
27}; // namespace Sensor
28}; // namespace Supla
29
30#endif // SRC_SUPLA_SENSOR_DISTANCE_H_
Definition channel_element.h:15
Definition distance.h:13
void iterateAlways() override
Method called on each SuplaDevice iteration.
Definition distance.cpp:17