MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / refresh

Method refresh

Arduino/libraries/ST_Anything/EX_Alarm.cpp:99–119  ·  view source on GitHub ↗

called periodically to ensure state of the Alarm Siren is up to date in the SmartThings Cloud (in case an event is missed)

Source from the content-addressed store, hash-verified

97
98 //called periodically to ensure state of the Alarm Siren is up to date in the SmartThings Cloud (in case an event is missed)
99 void EX_Alarm::refresh()
100 {
101 //if (debug) {
102 // Serial.print(F("EX_Alarm:: UseStrobe = "));
103 // Serial.println(m_bUseStrobe);
104 //}
105
106 if (m_nCurrentAlarmState == both) {
107 Everything::sendSmartString(getName() + F(" both"));
108 }
109 else if(m_nCurrentAlarmState == siren) {
110 Everything::sendSmartString(getName() + F(" siren"));
111 }
112 else if(m_nCurrentAlarmState == strobe) {
113 Everything::sendSmartString(getName() + F(" strobe"));
114 }
115 else if(m_nCurrentAlarmState == off) {
116 //else {
117 Everything::sendSmartString(getName() + F(" off"));
118 }
119 }
120
121 //SmartThings Shield data handler (receives command to turn "both" or "off" the Alarm (digital output)
122 void EX_Alarm::beSmart(const String &str)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected