- String str = resourcerequest
- .getResourceRepresentation()
- .getValueString("power");
- if (str.equals("on")) {
- lightState.setOn(true);
- Activator.myLight.m_power = "on";
- } else if (str.equals("off")) {
- lightState.setOn(false);
- Activator.myLight.m_power = "off";
+ try {
+ String str = resourcerequest
+ .getResourceRepresentation()
+ .getValue("power");
+ if (str.equals("on")) {
+ lightState.setOn(true);
+ Activator.myLight.m_power = "on";
+ } else if (str.equals("off")) {
+ lightState.setOn(false);
+ Activator.myLight.m_power = "off";
+ }
+ int setHueValue = resourcerequest
+ .getResourceRepresentation()
+ .getValue("color");
+ lightState.setHue(setHueValue);
+ Activator.myLight.m_color = resourcerequest
+ .getResourceRepresentation()
+ .getValue("color");
+ } catch (OcException e) {
+ // TODO Auto-generated catch block
+ Log.e(TAG, e.getMessage());