14#ifndef SRC_SUPLA_CONTROL_BISTABLE_RELAY_H_
15#define SRC_SUPLA_CONTROL_BISTABLE_RELAY_H_
17#include <supla-common/proto.h>
47 bool statusPullUp =
true,
48 bool statusHighIsOn =
true,
50 _supla_int_t functions =
51 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
55 _supla_int_t functions =
56 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
73 bool statusPullUp =
true,
74 bool statusHighIsOn =
true,
76 _supla_int_t functions =
77 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
96 bool statusPullUp =
true,
97 bool statusHighIsOn =
true,
99 _supla_int_t functions =
100 (0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER));
105 void turnOn(_supla_int_t duration = 0)
override;
106 void turnOff(_supla_int_t duration = 0)
override;
107 void toggle(_supla_int_t duration = 0)
override;
108 void handleAction(
int event,
int action)
override;
110 bool isOn()
override;
111 bool isStatusUnknown();
114 bool canUseWeeklySchedule()
const override;
115 bool applyWeeklyScheduleState(
bool on)
override;
116 void internalToggle();
118 uint32_t disarmTimeMs = 0;
119 uint32_t lastReadTime = 0;
123 bool lastCommandTurnOn =
false;
Definition bistable_relay.h:29
void iterateAlways() override
Method called on each SuplaDevice iteration.
Definition bistable_relay.cpp:122
void onInit() override
Third method called on element in SuplaDevice.begin()
Definition bistable_relay.cpp:102
BistableRelay(int pin, int statusPin=-1, bool statusPullUp=true, bool statusHighIsOn=true, bool highIsOn=true, _supla_int_t functions=(0xFF ^ SUPLA_BIT_FUNC_CONTROLLINGTHEROLLERSHUTTER))
BistableRelay constructor which works on ESP's GPIO (with defaul Supla::Io)
Definition bistable_relay.cpp:72
int32_t handleNewValueFromServer(TSD_SuplaChannelNewValue *newValue) override
Handles "new value" request from server.
Definition bistable_relay.cpp:147