27#ifndef SRC_SUPLA_CONTROL_BISTABLE_RELAY_H_
28#define SRC_SUPLA_CONTROL_BISTABLE_RELAY_H_
30#include <supla-common/proto.h>
38class BistableRelay :
public Relay {
43 bool statusPullUp =
true,
44 bool statusHighIsOn =
true,
46 _supla_int_t functions =
47 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
48 BistableRelay(
int pin,
50 bool statusPullUp =
true,
51 bool statusHighIsOn =
true,
53 _supla_int_t functions =
54 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
58 void turnOn(_supla_int_t duration = 0)
override;
59 void turnOff(_supla_int_t duration = 0)
override;
60 void toggle(_supla_int_t duration = 0)
override;
63 bool isStatusUnknown();
66 void internalToggle();
68 uint32_t disarmTimeMs = 0;
69 uint32_t lastReadTime = 0;
71 int16_t statusPin = -1;
72 bool statusPullUp =
true;
73 bool statusHighIsOn =
true;
void iterateAlways() override
Method called on each SuplaDevice iteration.
Definition bistable_relay.cpp:85
void onInit() override
Third method called on element in SuplaDevice.begin()
Definition bistable_relay.cpp:62
int32_t handleNewValueFromServer(TSD_SuplaChannelNewValue *newValue) override
Handles "new value" request from server.
Definition bistable_relay.cpp:99