Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
Diff: LightSwitchAction.cpp
- Revision:
- 87:e9d77e9f9eae
- Parent:
- 21:cfdaee0a2b50
- Child:
- 192:54b758a8eaaa
diff -r 8ddeaa7389a6 -r e9d77e9f9eae LightSwitchAction.cpp --- a/LightSwitchAction.cpp Wed Mar 12 20:07:50 2014 +0000 +++ b/LightSwitchAction.cpp Wed Mar 12 23:47:30 2014 +0000 @@ -35,6 +35,10 @@ this->logger()->log("Turning Light: %s ON",this->light()->getName()); this->on(); } + else if (value != NULL && strcmp(value,"2") == 0) { + this->logger()->log("Blinking Light: %s...",this->light()->getName()); + this->blink(); + } else { this->logger()->log("Turning Light: %s OFF",this->light()->getName()); this->off(); @@ -46,6 +50,9 @@ // Light turned OFF void LightSwitchAction::off() { this->light()->off(); } + + // Blink light + void LightSwitchAction::blink() { this->light()->blink(); } // get the light Light *LightSwitchAction::light() { return this->m_light; } \ No newline at end of file