27#ifndef SRC_SUPLA_CONTROL_BISTABLE_RELAY_H_
28#define SRC_SUPLA_CONTROL_BISTABLE_RELAY_H_
30#include <supla-common/proto.h>
40class BistableRelay :
public Relay {
45 bool statusPullUp =
true,
46 bool statusHighIsOn =
true,
48 _supla_int_t functions =
49 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
50 BistableRelay(
int pin,
52 bool statusPullUp =
true,
53 bool statusHighIsOn =
true,
55 _supla_int_t functions =
56 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
60 void turnOn(_supla_int_t duration = 0)
override;
61 void turnOff(_supla_int_t duration = 0)
override;
62 void toggle(_supla_int_t duration = 0)
override;
65 bool isStatusUnknown();
68 void internalToggle();
70 uint32_t disarmTimeMs = 0;
71 uint32_t lastReadTime = 0;
73 int16_t statusPin = -1;
74 bool statusPullUp =
true;
75 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