Core Base Classes for the Light Endpoints

Dependencies:   BufferedSerial

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more

Revision:
21:cfdaee0a2b50
Parent:
9:90fadae5489a
Child:
192:54b758a8eaaa
diff -r f2dbbd852e08 -r cfdaee0a2b50 LightDimmerAction.cpp
--- a/LightDimmerAction.cpp	Wed Feb 26 18:59:01 2014 +0000
+++ b/LightDimmerAction.cpp	Wed Feb 26 21:29:18 2014 +0000
@@ -26,6 +26,16 @@
  // destructor
  LightDimmerAction::~LightDimmerAction() {
  }
+ 
+ // DIM the light
+ void LightDimmerAction::dim() { 
+    ResourceFactory *resource = this->light()->getResourceFactory();
+    char *str_value = resource->getResourceValue(DIMMING_RESOURCE);
+    int value = 0;
+    sscanf(str_value,"%d",&value);
+    this->logger()->log("Dimming Light: %s  Value: %d",this->light()->getName(),value);
+    this->dim(value);
+ }
 
  // DIM the light
  void LightDimmerAction::dim(int value) { this->light()->dim(value); }