initial import(release): app plugin 59/185459/5
authorjohnny nam <johnny@dignsys.com>
Tue, 31 Jul 2018 02:24:51 +0000 (11:24 +0900)
committerscott park <scott.park@dignsys.com>
Wed, 12 Sep 2018 14:11:00 +0000 (23:11 +0900)
Change-Id: Icc47a810c6f3f3c1d4f85903112ddda8fe574b24
Signed-off-by: scott park <scott.park@dignsys.com>
22 files changed:
plugin/catalog.json [new file with mode: 0644]
plugin/device-profile.json [new file with mode: 0644]
plugin/manifest/ui.json [new file with mode: 0644]
plugin/plugin/css/fonts.css [new file with mode: 0644]
plugin/plugin/css/sensor-blind.css [new file with mode: 0644]
plugin/plugin/css/style.css [new file with mode: 0644]
plugin/plugin/icon.png [new file with mode: 0644]
plugin/plugin/index.html [new file with mode: 0644]
plugin/plugin/js/capability_doorControl.js [new file with mode: 0644]
plugin/plugin/js/capability_illuminanceMeasurement.js [new file with mode: 0644]
plugin/plugin/js/capability_switch.js [new file with mode: 0644]
plugin/plugin/js/index.js [new file with mode: 0644]
plugin/plugin/manifest.xml [new file with mode: 0644]
plugin/plugin/res/blind-close-6.png [new file with mode: 0644]
plugin/plugin/res/blind-open-6.png [new file with mode: 0644]
plugin/plugin/res/board_ic_arrow_left.png [new file with mode: 0644]
plugin/plugin/res/ic_power.svg [new file with mode: 0644]
plugin/plugin/res/icon-cloudy.png [new file with mode: 0644]
plugin/plugin/res/icon-night.png [new file with mode: 0644]
plugin/plugin/res/icon-sunny.png [new file with mode: 0644]
plugin/plugin/res/lux.png [new file with mode: 0644]
plugin/plugin/res/option_ic_more.svg [new file with mode: 0644]

diff --git a/plugin/catalog.json b/plugin/catalog.json
new file mode 100644 (file)
index 0000000..63f2560
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "items": [
+    {
+      "name": "illuOnly2door",
+      "appType": "setupApp",
+      "versions": [
+        {
+          "appData": {
+            "setupAppData": {
+              "type": "ocf",
+              "ocf": {
+                "mnId": "",
+                "setupId": "001"
+              }
+            }
+          }
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file
diff --git a/plugin/device-profile.json b/plugin/device-profile.json
new file mode 100644 (file)
index 0000000..d176ea0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "name": "illu_blind",
+  "components": [
+    {
+      "id": "main",
+      "capabilities": [
+        {
+          "id": "switch"
+        },
+        {
+          "id": "illuminanceMeasurement"
+        },
+        {
+          "id": "doorControl"
+        }
+      ]
+    }
+  ],
+  "metadata": {
+    "mnmn": "",
+    "vid": "illuBlind",
+    "deviceType": "Light"
+  }
+}
diff --git a/plugin/manifest/ui.json b/plugin/manifest/ui.json
new file mode 100644 (file)
index 0000000..0f4c037
--- /dev/null
@@ -0,0 +1,405 @@
+{
+       "n": "illu_blind",
+       "version": "0.0.1",
+       "vid": "",
+       "mnmn": "",
+       "language": [
+               {
+                       "locale": "en_US",
+                       "version": "0.0.1",
+                       "poCodes": [
+                               {
+                                       "po": "___PO_CODE_POWERSWITCH_ON",
+                                       "label": "On"
+                               },
+                               {
+                                       "po": "___PO_CODE_POWERSWITCH_OFF",
+                                       "label": "Off"
+                               },
+                               {
+                                       "po": "___PO_CODE_POWERSWITCH",
+                                       "label": "Power"
+                               },
+                               {
+                                       "label": "Illuminance",
+                                       "po": "___PO_CODE_ILLUMINANCEMEASUREMENT_ILLUMINANCE"
+                               },
+                               {
+                                       "label": "Close",
+                                       "po": "___PO_CODE_DOORCONTROL_CLOSE"
+                               },
+                               {
+                                       "label": "Open",
+                                       "po": "___PO_CODE_DOORCONTROL_OPEN"
+                               },
+                               {
+                                       "label": "Unknown",
+                                       "po": "___PO_CODE_DOORCONTROL_UNKNOWN"
+                               },
+                               {
+                                       "label": "Opening",
+                                       "po": "___PO_CODE_DOORCONTROL_OPENING"
+                               },
+                               {
+                                       "label": "Closing",
+                                       "po": "___PO_CODE_DOORCONTROL_CLOSING"
+                               },
+                               {
+                                       "label": "Door control",
+                                       "po": "___PO_CODE_DOORCONTROL"
+                               },
+                               {
+                                       "label": "Closed",
+                                       "po": "___PO_CODE_DOORCONTROL_CLOSED"
+                               }
+                       ],
+                       "mnmn": "",
+                       "vid": ""
+               }
+       ],
+       "ma": [
+               {
+                       "name": "PowerSwitch",
+                       "type": "main",
+                       "order": 1,
+                       "link": {
+                               "href": "/capability/switch/main/0",
+                               "if": "oic.if.a",
+                               "rt": "x.com.st.powerswitch"
+                       },
+                       "iconUrl": {
+                               "vector": "",
+                               "small": "",
+                               "large": "",
+                               "mid": "icon://ic_function_power_switch"
+                       },
+                       "property": "power",
+                       "controlType": "ToggleSwitch",
+                       "alternatives": [
+                               {
+                                       "key": "on",
+                                       "value": "___PO_CODE_POWERSWITCH_ON"
+                               },
+                               {
+                                       "key": "off",
+                                       "value": "___PO_CODE_POWERSWITCH_OFF",
+                                       "type": "inactive"
+                               }
+                       ],
+                       "step": 0,
+                       "label": {
+                               "label": "___PO_CODE_POWERSWITCH"
+                       },
+                       "emphasis": false
+               }
+       ],
+       "ms": [
+               {
+                       "name": "PowerSwitch",
+                       "type": "device",
+                       "order": 1,
+                       "label": {
+                               "label": "<var1>",
+                               "arguments": [
+                                       {
+                                               "n": "var1",
+                                               "href": "/capability/switch/main/0",
+                                               "property": "power",
+                                               "valueType": null,
+                                               "alternatives": [
+                                                       {
+                                                               "key": "on",
+                                                               "value": "___PO_CODE_POWERSWITCH_ON"
+                                                       },
+                                                       {
+                                                               "key": "off",
+                                                               "value": "___PO_CODE_POWERSWITCH_OFF",
+                                                               "type": "inactive"
+                                                       }
+                                               ]
+                                       }
+                               ]
+                       },
+                       "emphasis": false
+               }
+       ],
+       "dpInfo": [
+               {
+                       "os": "android",
+                       "dpType": "vendorPlugIn",
+                       "dpUri": "wwst://illOnly2door"
+               },
+               {
+                       "os": "ios",
+                       "dpType": "vendorPlugIn",
+                       "dpUri": "wwst://illOnly2door"
+               }
+       ],
+       "dpResources": [
+               {
+                       "name": "PowerSwitch",
+                       "controllable": true,
+                       "order": 1,
+                       "link": {
+                               "href": "/capability/switch/main/0",
+                               "if": "oic.if.a",
+                               "rt": "x.com.st.powerswitch"
+                       },
+                       "iconUrl": {
+                               "vector": "",
+                               "small": "",
+                               "large": "",
+                               "mid": "icon://ic_function_power_switch"
+                       },
+                       "property": "power",
+                       "controlType": "ToggleSwitch",
+                       "alternatives": [
+                               {
+                                       "key": "on",
+                                       "value": "___PO_CODE_POWERSWITCH_ON"
+                               },
+                               {
+                                       "key": "off",
+                                       "value": "___PO_CODE_POWERSWITCH_OFF",
+                                       "type": "inactive"
+                               }
+                       ],
+                       "step": 0,
+                       "label": {
+                               "label": "___PO_CODE_POWERSWITCH"
+                       },
+                       "emphasis": true,
+                       "ruleEvent": false,
+                       "ruleAction": true
+               },
+               {
+                       "name": "PowerSwitch",
+                       "controllable": true,
+                       "order": 2,
+                       "link": {
+                               "href": "/capability/switch/main/0",
+                               "if": "oic.if.a",
+                               "rt": "x.com.st.powerswitch"
+                       },
+                       "iconUrl": {
+                               "vector": "",
+                               "small": "",
+                               "large": "",
+                               "mid": "icon://ic_function_power_switch"
+                       },
+                       "property": "power",
+                       "controlType": "ToggleSwitch",
+                       "alternatives": [
+                               {
+                                       "key": "on",
+                                       "value": "___PO_CODE_POWERSWITCH_ON"
+                               },
+                               {
+                                       "key": "off",
+                                       "value": "___PO_CODE_POWERSWITCH_OFF",
+                                       "type": "inactive"
+                               }
+                       ],
+                       "step": 0,
+                       "label": {
+                               "label": "___PO_CODE_POWERSWITCH"
+                       },
+                       "emphasis": true,
+                       "ruleEvent": false,
+                       "ruleAction": false
+               },
+               {
+                       "name": "PowerSwitch",
+                       "controllable": true,
+                       "order": 3,
+                       "link": {
+                               "href": "/capability/switch/main/0",
+                               "if": "oic.if.a",
+                               "rt": "x.com.st.powerswitch"
+                       },
+                       "iconUrl": {
+                               "vector": "",
+                               "small": "",
+                               "large": "",
+                               "mid": "icon://ic_function_power_switch"
+                       },
+                       "property": "power",
+                       "controlType": "ToggleSwitch",
+                       "alternatives": [
+                               {
+                                       "key": "on",
+                                       "value": "___PO_CODE_POWERSWITCH_ON"
+                               },
+                               {
+                                       "key": "off",
+                                       "value": "___PO_CODE_POWERSWITCH_OFF",
+                                       "type": "inactive"
+                               }
+                       ],
+                       "step": 0,
+                       "label": {
+                               "label": "___PO_CODE_POWERSWITCH"
+                       },
+                       "emphasis": true,
+                       "ruleEvent": true,
+                       "ruleAction": false
+               },
+               {
+                       "ruleAction": false,
+                       "controllable": false,
+                       "link": {
+                               "rt": "oic.r.sensor.illuminance",
+                               "href": "/capability/illuminanceMeasurement/main/0",
+                               "if": "oic.if.r"
+                       },
+                       "step": 0,
+                       "controlType": "List",
+                       "name": "Illuminance Measurement",
+                       "label": {
+                               "label": "___PO_CODE_ILLUMINANCEMEASUREMENT_ILLUMINANCE",
+                               "n": "ST Illuminance Measurement"
+                       },
+                       "emphasis": false,
+                       "ruleEvent": false,
+                       "iconUrl": {
+                               "mid": "icon://ic_function_illuminance_measurement",
+                               "large": "",
+                               "small": "",
+                               "vector": ""
+                       },
+                       "order": 4,
+                       "property": "illuminance"
+               },
+               {
+                       "ruleAction": false,
+                       "emphasis": false,
+                       "controllable": true,
+                       "step": 0,
+                       "link": {
+                               "rt": "x.com.st.doorcontrol",
+                               "href": "/capability/doorControl/main/0",
+                               "if": "oic.if.a"
+                       },
+                       "controlType": "List",
+                       "name": "Door Control",
+                       "label": {
+                               "label": "___PO_CODE_DOORCONTROL"
+                       },
+                       "iconUrl": {
+                               "mid": "icon://ic_function_door_control",
+                               "large": "",
+                               "small": "",
+                               "vector": ""
+                       },
+                       "ruleEvent": false,
+                       "alternatives": [
+                               {
+                                       "value": "___PO_CODE_DOORCONTROL_CLOSING",
+                                       "key": "closing",
+                                       "type": "inactive"
+                               },
+                               {
+                                       "value": "___PO_CODE_DOORCONTROL_OPENING",
+                                       "key": "opening",
+                                       "type": "active"
+                               },
+                               {
+                                       "value": "___PO_CODE_DOORCONTROL_CLOSED",
+                                       "key": "closed",
+                                       "type": "inactive"
+                               },
+                               {
+                                       "value": "___PO_CODE_DOORCONTROL_OPEN",
+                                       "key": "open",
+                                       "type": "active"
+                               },
+                               {
+                                       "value": "___PO_CODE_DOORCONTROL_UNKNOWN",
+                                       "key": "unknown",
+                                       "type": "inactive"
+                               }
+                       ],
+                       "order": 5,
+                       "property": "doorState"
+               },
+               {
+                       "ruleAction": false,
+                       "emphasis": false,
+                       "controllable": true,
+                       "step": 0,
+                       "link": {
+                               "rt": "x.com.st.doorcontrol",
+                               "href": "/capability/doorControl/main/0",
+                               "if": "oic.if.a"
+                       },
+                       "controlType": "List",
+                       "name": "Door Control",
+                       "label": {
+                               "label": "___PO_CODE_DOORCONTROL"
+                       },
+                       "iconUrl": {
+                               "mid": "icon://ic_function_door_control",
+                               "large": "",
+                               "small": "",
+                               "vector": ""
+                       },
+                       "ruleEvent": true,
+                       "alternatives": [
+                               {
+                                       "type": "inactive",
+                                       "value": "___PO_CODE_DOORCONTROL_CLOSING",
+                                       "key": "closing"
+                               },
+                               {
+                                       "type": "inactive",
+                                       "value": "___PO_CODE_DOORCONTROL_CLOSED",
+                                       "key": "closed"
+                               },
+                               {
+                                       "type": "active",
+                                       "value": "___PO_CODE_DOORCONTROL_OPENING",
+                                       "key": "opening"
+                               },
+                               {
+                                       "type": "active",
+                                       "value": "___PO_CODE_DOORCONTROL_OPEN",
+                                       "key": "open"
+                               }
+                       ],
+                       "order": 6,
+                       "property": "doorState"
+               },
+               {
+                       "name": "Door Control",
+                       "controllable": true,
+                       "order": 7,
+                       "link": {
+                               "rt": "x.com.st.doorcontrol",
+                               "href": "/capability/doorControl/main/0",
+                               "if": "oic.if.a"
+                       },
+                       "property": "doorState",
+                       "controlType": "List",
+                       "alternatives": [
+                               {
+                                       "key": "closing",
+                                       "value": "___PO_CODE_DOORCONTROL_CLOSE",
+                                       "type": "inactive"
+                               }
+                       ],
+                       "step": 0,
+                       "iconUrl": {
+                               "mid": "icon://ic_function_door_control",
+                               "large": "",
+                               "small": "",
+                               "vector": ""
+                       },
+                       "label": {
+                               "label": "___PO_CODE_DOORCONTROL"
+                       },
+                       "emphasis": false,
+                       "ruleEvent": false,
+                       "ruleAction": true
+               }
+       ]
+}
\ No newline at end of file
diff --git a/plugin/plugin/css/fonts.css b/plugin/plugin/css/fonts.css
new file mode 100644 (file)
index 0000000..cf72e24
--- /dev/null
@@ -0,0 +1,23 @@
+@CHARSET "UTF-8";
+
+.roboto-regular
+{
+       font-family: 'sec-roboto-light', Fallback, sans-serif;
+}
+
+.roboto-medium
+{
+       font-family: 'sec-roboto-light', Fallback, sans-serif;
+       font-weight: bold;
+}
+
+.roboto-condensed-regular
+{
+       font-family: 'sec-roboto-condensed', Fallback, sans-serif;
+}
+
+.roboto-condensed-bold
+{
+       font-family: 'sec-roboto-condensed', Fallback, sans-serif;
+       font-weight: bold;
+}
diff --git a/plugin/plugin/css/sensor-blind.css b/plugin/plugin/css/sensor-blind.css
new file mode 100644 (file)
index 0000000..d61dc39
--- /dev/null
@@ -0,0 +1,178 @@
+.illuminance_value_wrap {
+       text-align:center;
+width: 100%;
+       padding-top: 0px;
+       height: 60px;
+       display: inline-block;
+       color: #252525;
+  /* border-bottom: rgba(0,0,0,0.07) solid 1px; */
+//     border-top: rgba(0,0,0,0.3) solid 2px;
+//     border-bottom: rgba(0,0,0,0.3) solid 2px;
+       background: white;
+       margin-left: auto;
+       margin-right: auto; }
+.illuminance_value { height: 40px; width: 55%; text-align: right; font-size: 32px; padding-right: 0px;         vertical-align: middle; line-height: 40px; }
+.illuminance_value_unit {
+       width:37%; height: 60px; font-size: 24px; text-align: left; padding-left: 5px; border-left: line-height: 40px; vertical-align: middle;
+ }
+
+.measure_container, .set_button_container { text-align: center;  padding: 0px 0; }
+.measure_container { width: 300px;
+       margin-left: auto;
+       margin-right: auto; }
+.img-class { width: 100%; }
+
+.updn_set_button {
+       text-align:center;
+       width: 40px;
+       height: 40px;
+       display: inline-block;
+       vertical-align: middle;
+       margin: 0px 5px;
+       background: white;
+       line-height: 53px;
+       border-radius: 23px;
+       border: 2px solid #3695dd;
+       color: #3695dd;
+}
+.updn_set_button:hover {
+       background: #dbefff;
+}
+.updn_set_button:active {
+       background: white;
+}
+
+input { float: left; width: 120px; height: 42px; line-height: 38px;
+  font-weight: 700; font-size: 18px; text-align: center; border-radius: 30px;
+       color: #3695dd; border: 2px solid #3695dd; background-color: transparent; cursor: pointer;
+  outline: none; align: center; -webkit-appearance: none; appearance: none; }
+input:hover { background: #dbefff; }
+input:focus { background-color: white; color: #3695dd; cursor: pointer; }
+/* hide up/down arrows on input fields marked type=number */
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
+
+#autoMode {
+       background: white;
+       color: #b4b4b4;
+       border-color: #b4b4b4;
+       }
+
+#blind_status_area {
+       margin-top: 0px;
+       margin-left: auto;
+       margin-right: auto;
+       width: 280px; // width: 70%;
+       height: auto;
+       position: relative;
+       text-align: center;
+       color: white;
+       font-size: 25px;
+}
+
+#blind_status_area_text {
+       position: absolute;
+       top: 50%;
+       left: 50%;
+       transform: translate(-50%, -50%);
+}
+
+span { display: inline-block; vertical-align: middle; }
+
+.status_width {
+       width: 300px;
+       display: inline-block; // margin-bottom: 10px;
+}
+
+.status-container {
+       margin: 0 0 0 0px;
+       text-align:center;
+       padding: 0px 0px;
+}
+
+//.updn_set_button > img { text-align: center; }
+
+table, td {
+       border-collapse: collapse;
+       font-weight: midium;
+       font-size: 14px;
+color: #252525;
+}
+table {
+       //float: center;
+       width: 300px;
+       //background-color: #e1e1e1;
+}
+td {
+       vertical-align: middle;
+       width: 100px;
+       height: 55px;
+       text-align: right;
+//     border: solid #fafafa 2px;
+padding: 2px 0px 0px 0px;
+}
+
+.rotateimg90 {
+  transform: rotate(90deg);
+}
+.rotateimg-90 {
+  transform: rotate(-90deg);
+}
+
+.button {
+       color: #3695dd;
+       border: 2px solid #3695dd;
+       background-color: transparent;
+       height: 42px;
+       font-size: 18px;
+       padding: 10px 20px;
+       text-align: center;
+       display: inline-block;
+       margin: 4px 4px;
+       cursor: pointer;
+       border-radius: 2px;
+}
+.button:hover { background-color: #3695dd; color: white; }
+
+.desc_bar {
+       margin-top: 10px;
+       width: 300px;
+       margin-left: auto;
+       margin-right: auto;
+       background-color: white;
+       //height: 42px;
+       //font-size: 18px;
+}
+.dummy-line {
+       background-color: transparent;
+       height: 10px;}
+
+.status_select {
+       border-top: 2px solid #3695dd;
+       border-bottom: 2px solid #3695dd;
+}
+.svg-class-A {
+  width: auto;
+  height: 60px;
+}
+#autoMode {
+       background: white;
+       color: #b4b4b4;
+       border-color: #b4b4b4;
+       }
+
+.outline { border: solid #3695dd 2px; }
+
+.greyL_back{ background-color: #e1e1e1; }
+.grey_back{ background-color: grey; }
+.black_back{ background-color: black; color: white; }
+.white_back{ background-color: white; }
+
+.cyan_back{ background-color: #3da8e1; }
+.green_back{ background-color: #8Fcc44; }
+.orange_back{ background-color: orange; }
+.red_back{ background-color: red; }
+
+.border_up { border-top: rgba(0,0,0,0.3) solid 2px; }
+.border_dn { border-bottom: rgba(0,0,0,0.3) solid 2px; }
+.underline { border-bottom: rgba(0,0,0,0.3) solid 2px; }
diff --git a/plugin/plugin/css/style.css b/plugin/plugin/css/style.css
new file mode 100644 (file)
index 0000000..0c49a11
--- /dev/null
@@ -0,0 +1,397 @@
+@charset "utf-8";
+@import url("fonts.css");
+body {
+       /*position: fixed;*/
+       width:100%;
+       height:100%;
+       top: 0px;
+       bottom: 0px;
+       left: 0px;
+       right: 0px;
+       background-color: white;
+       margin: 0;
+       padding: 0;
+       display:flex;
+       flex-direction: column;
+}
+
+.status_sub_bar {
+  text-align: center;
+  font-weight: midium;
+  font-size: 15px;
+  color: #252525;
+  padding: 3px 0;
+  opacity:0.9;
+}
+
+/* .plugin-container { flex: 1; overflow:auto; } */
+
+#action_bar {
+       border-bottom: rgba(0,0,0,0.07) solid 1px;
+       display:flex;
+       background-color: #fafafa;
+}
+
+#header_bar {
+       min-height: 50px;
+       display:flex;
+       margin-left: auto;
+       margin-right: 10px;
+}
+
+#action_bar,
+#action_bar_back_button,
+#action_bar_title,
+#action_bar_menu {
+       min-height: 48px;
+/*     background-color: #fafafa;*/
+}
+
+#action_bar_more {
+       width: 56px;
+       display:flex;
+       align-items: center;
+       justify-content: center;
+       cursor: pointer;
+       margin: 15px 0 15px 15px;
+       /*background-color: red;*/
+}
+
+#action_bar_more:before {
+       content: "";
+       background-image: url("../res/option_ic_more.svg");
+       background-size: contain;
+       background-repeat: no-repeat;
+       background-position: center;
+       width: 100%;
+       height: 18px;
+       display: block;
+}
+
+#action_bar_back_button {
+       width: 56px;
+       display:flex;
+       align-items: center;
+       justify-content: center;
+       cursor: pointer;
+       -webkit-tap-highlight-color: transparent;
+}
+
+#action_bar_menu {
+       width: 48px;
+       visibility:hidden;
+}
+
+#action_bar_title {
+       text-overflow: ellipsis;
+       white-space: nowrap;
+       flex:1;
+       margin-left : 15px;
+}
+
+#action_bar_title_main {
+       font-size:23px;
+       color: #252525;
+       font-stretch: condensed;
+}
+
+#action_bar_title_sub {
+       font-size:13px;
+       color: #252525;
+       opacity: 0.6;
+       font-stretch: condensed;
+}
+/*
+#loading {
+       display:flex;
+       flex-direction: column;
+}
+
+#loading .img {
+       width: 60px;
+       height: 60px;
+       animation: spin 1s linear infinite;
+}
+*/
+@keyframes spin {
+       0% { transform: rotate(0deg); }
+       100% { transform: rotate(360deg); }
+}
+
+.dot {
+       fill: #499ebd;
+}
+
+#icon_back .back_arrow {
+       fill: none;
+       stroke: #499ebd;
+       stroke-width: 7;
+}
+
+#icon_back {
+       max-width:24px;
+       max-height:24px;
+}
+
+#icon_menu_box {
+       display:flex;
+       align-items: center;
+       justify-content: center;
+}
+
+#icon_menu {
+       max-height:24px;
+       cursor: pointer;
+       -webkit-tap-highlight-color: transparent;
+}
+
+#action_bar_menu ul {
+       position: absolute;
+       right: 5px;
+       padding: 0px;
+       margin: 0px;
+       background-color: #fafafa;
+       max-height: 0;
+       transition: max-height 0.15s ease-out;
+       overflow: hidden;
+       border-radius: 5px;
+       z-index: 2;
+       position:absolute;
+       top:10px;
+}
+
+#action_bar_menu ul li {
+       min-width: 150px;
+       display: flex;
+       align-items: center;
+       white-space: nowrap;
+}
+
+#action_bar_menu ul li a {
+       display: inline-block;
+       margin: auto;
+       padding: 10px;
+       text-decoration: none;
+       color: black;
+       -webkit-tap-highlight-color: transparent;
+}
+
+#action_bar_menu ul li:hover {
+       background: #eee;
+}
+
+#action_bar_menu ul li:first-child {
+       border-radius: 5px 5px 0px 0px;
+       border-top: 1px #bbb solid;
+       border-left: 1px #bbb solid;
+       border-right: 1px #bbb solid;
+}
+
+#action_bar_menu ul li:last-child {
+       border-radius: 0px 0px 5px 5px;
+       border-bottom: 1px #bbb solid;
+       border-left: 1px #bbb solid;
+       border-right: 1px #bbb solid;
+}
+
+#action_bar_menu ul li:only-child {
+       border-radius: 5px;
+       border: 1px #bbb solid;
+}
+
+#action_bar_menu ul li {
+       border-left: 1px #bbb solid;
+       border-right: 1px #bbb solid;
+}
+
+#action_bar_menu.active ul {
+       max-height: 1000px;
+       transition: max-height 0.25s ease-in;
+}
+
+.button {
+       border-radius: 5px;
+       border-color: #d4d4d4;
+       border-style: solid;
+       border-width: 1px;
+       display: inline;
+       padding: 8px;
+}
+
+#power_icon_back_circle {
+  border-radius: 50%;
+  background: #3695dd;
+  width: 35px;
+  height: 35px;
+  margin: 10px 20px 0 auto;
+  display:flex;
+  align-items: center;
+}
+
+.svg-class {
+  width: 100%;
+  height: auto;
+}
+
+#svg-status-id {
+  width: 100%;
+  height: 100%;
+}
+
+#combo_area {
+  display: block;
+  align-items: center;
+  justify-content: center;
+  margin: 5px 0px;
+}
+
+.mode_bar {
+  border-radius: 17px;
+  height: 35px;
+  width: 220px;
+  border: 2px solid #3695dd;
+}
+
+.mode_bar_text {
+  color: #3695dd;
+  font-size: 17px;
+  text-align-last:center;
+}
+
+.status-container {
+       margin-top:20px;
+       text-align:center;
+       margin-bottom:20px;
+}
+
+.status_item_title {
+  text-align: center;
+  font-weight: regular;
+  font-size: 15px;
+  color: #252525;
+  opacity:0.8;
+}
+
+.status_item_content {
+  text-align: center;
+  font-weight: midium;
+  font-size: 15px;
+  color: #252525;
+}
+
+.function_container{
+  margin: 0 0 0 5%;
+  padding: 10px;
+  border-bottom: rgba(0,0,0,0.07) solid 1px;
+}
+
+.function_item{
+  height:75px;
+  width:100%;
+  color: white;
+}
+
+.item_icon {
+       width:30px;
+       height:30px;
+       display:inline-block;
+}
+
+.item_body {
+       width:150px;
+       height:40px;
+       display: inline-block;
+}
+
+.function_item_singleline{
+       margin: 0;
+       font-size: 0.8rem;
+       line-height: 1rem;
+       color: #252525;
+       margin-left: .8rem;
+       float: left;
+       padding-top: 1.275rem;
+       white-space: nowrap;
+       max-width: 12.4rem;
+       display:inline;
+}
+.function_item_multiline{
+       padding-top: 0.8rem;
+       margin-left: .8rem;;
+       float: left;
+       display:inline;
+}
+
+.function_item_multiline_1{
+       margin: 0;
+       font-size: 0.8rem;
+       line-height: 0.85rem;
+       color: #252525;
+  opacity:0.9;
+}
+
+.function_item_multiline_2{
+       margin: 0;
+       color: #3695dd;
+       font-size: 0.7rem;
+       line-height: 0.7rem;
+       padding-top: 0.25rem;
+}
+
+.row-custom {
+  content: "";
+  clear: both;
+  display: block;
+  height: inherit;
+}
+
+.left-col {
+  float: left;
+  width: 100%;
+  background-color: #fafafa;
+}
+
+.right-col {
+  float: left;
+  width: 100%;
+}
+
+/* ---------- icon ------------- */
+
+.plus_icon { border-radius: 50%; background: #ffffff; }
+.plus_icon:before {
+  content: "";
+  background-image: url("../res/set_point_ic_plus.png");
+  background-size: contain;
+  width: 100%; height: 100%; display: block; }
+.minus_icon { border-radius: 50%; background: #ffffff; }
+.minus_icon:before {
+  content: "";
+  background-image: url("../res/set_point_ic_minus.png");
+  background-size: contain;
+  width: 100%; height: 100%; display: block; }
+.arrow_icon { position: absolute; right: 20px; margin-top: 15px;
+       color: #252525; opacity: 0.9; }
+.arrow_icon:before { content: ""; background-image: url("../res/list_ic_arrow.svg");
+  background-size: contain; width: 24px; height: 24px; display: block; }
+
+@media only screen and (orientation: landscape) and (min-height: 360px){
+  .left-col {
+       width: 50%;
+       height: inherit;
+  }
+
+  .right-col {
+       width: 50%;
+  }
+
+.function_container{
+  margin-left: 0;
+  }
+}
+
+@media only screen and (min-width: 768px) {
+  .left-col {
+       height: inherit;
+  }
+}
diff --git a/plugin/plugin/icon.png b/plugin/plugin/icon.png
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/plugin/plugin/index.html b/plugin/plugin/index.html
new file mode 100644 (file)
index 0000000..851d290
--- /dev/null
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html lang="ko">
+       <head>
+               <title>Blind Control using Illuminance Sensor</title>
+               <meta charset="utf-8">
+               <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+               <!-- Stylesheet-->
+               <link rel="stylesheet" type="text/css" href="css/style.css"/>
+               <link rel="stylesheet" type="text/css" href="css/sensor-blind.css"/>
+               <!-- SAMSUNG CONNECT API -->
+               <script type="text/javascript" src="lib/SCPluginApi.js"></script>
+               <script type="text/javascript" src="js/capability_switch.js"></script>
+               <script type="text/javascript" src="js/capability_doorControl.js"></script>
+               <script type="text/javascript" src="js/capability_illuminanceMeasurement.js"></script>
+               <script type="text/javascript" src="js/index.js"></script>
+
+       </head>
+       <body>
+               <!-- Action bar-->
+               <div id="action_bar">
+                       <span id="action_bar_back_button" onclick="backAction()">
+                               <img src="res/board_ic_arrow_left.png" style="width: 100%; height:auto;" id="icon_back"/>
+                       </span>
+                       <span id="action_bar_title">
+                               <div id="action_bar_title_sub" class="roboto-condensed-bold">HOME - LIVING ROOM</div>
+                               <div id="action_bar_title_main" class="roboto-condensed-bold">Blind Control</div>
+                       </span>
+                       <span id="action_bar_more"></span>
+               </div>
+
+               <div class="row-custom">
+                       <div class="left-col">
+                               <!-- Header-->
+                               <div id="header_bar">
+                                       <div id="power_icon_back_circle" onclick="onPowerBtnClicked()">
+                                               <img class="svg-class"src="res/ic_power.svg">
+                                       </div>
+                               </div>
+                       <div id="combo_area" align="center">
+                               <div class="mode_bar mode_bar_text roboto-condensed-bold" style="line-height:34px">Wondows Blind</div>
+                       </div>
+                       <div class="status_sub_bar roboto-condensed-regular">INDOOR</div>
+
+                       <!-- windows blind icon display area -->
+                       <div id="blind_status_area" class="roboto-condensed-regular">
+                               <img class="img-class" id="blind-status" src="res/blind-open-6.png"/>
+                               <div id="blind_status_area_text"></div>
+                       </div>
+
+                       <!-- up/down/auto button set area -->
+                       <div class="set_button_container">
+                               <span class="updn_set_button rotateimg-90" onclick="onSetBlindUpDnClicked(0)">
+                                       <img src="res/board_ic_arrow_left.png" style="width: 100%; height:auto;" id="icon_back"/>
+                               </span>
+                               <span><input type="button" id="autoMode" value="AUTO off" onclick="onSetBlindAutoModeClicked();" /></span>
+                               <span class="updn_set_button rotateimg90" onclick="onSetBlindUpDnClicked(1)">
+                                       <img src="res/board_ic_arrow_left.png" style="width: 100%; height:auto;" id="icon_back"/>
+                               </span>
+                       </div>
+
+                       <div class="status_sub_bar desc_bar roboto-condensed-regular">
+                               <strong>Auto Operation</strong> | day-open, night-close
+                       </div>
+                       <div class="dummy-line"></div><div class="dummy-line"></div><div class="dummy-line"></div><div class="dummy-line"></div>
+                       <div class="measure_container border_up">
+                               <!-- sensor value display area -->
+                               <div class="illuminance_value_wrap">
+                                       <span class="illuminance_value roboto-condensed-bold" id="illuminance">12,570</span>
+                                       <span class="illuminance_value_unit roboto-regular"><img class="svg-class-A" src="res/lux.png"/></span>
+                               </div>
+                               <!-- status description -->
+                               <table class="illuminance_status">
+                                       <tr> <td id="night"><img class="svg-class" src="res/icon-night.png"></td>
+                                               <td id="cloudy"><img class="svg-class" src="res/icon-cloudy.png"/></td>
+                                               <td id="sunny"><img class="svg-class" src="res/icon-sunny.png"></td>
+                                       </tr>
+                               </table>
+                               <div class="dummy-line"></div>
+                       </div>
+               </div>
+       </body>
+</html>
diff --git a/plugin/plugin/js/capability_doorControl.js b/plugin/plugin/js/capability_doorControl.js
new file mode 100644 (file)
index 0000000..3f694ce
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2015 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+var capabilityDoorControl = {
+       'href' : "/capability/doorControl/main/0",
+       'doorState' : "closeState",
+       'autoControl' : "false",
+
+       'update' : function() {
+               ocfDevice.getRemoteRepresentation(this.href, this.onRepresentCallback);
+       },
+
+       'onRepresentCallback' : function(result, deviceHandle, uri, rcsJsonString) {
+               scplugin.log.debug(className, arguments.callee.name, result);
+               scplugin.log.debug(className, arguments.callee.name, uri);
+
+               if (result == "OCF_OK" || result == "OCF_RESOURCE_CHANGED" || result == "OCF_RES_ALREADY_SUBSCRIBED") {
+               /* document.getElementById("svg-status-id").innerHTML = rcsJsonString["doorState"]; */
+
+               /* open, opening, closing, closed, unknown */
+                       if (rcsJsonString["doorState"] == "closed") {
+                               document.getElementById("blind-status").src = "res/blind-close-6.png";
+                               this.doorState = "closeState";
+                               this.autoControl = "false";
+                                               autoMode_on("off");
+                       } else if (rcsJsonString["doorState"] == "closing") {
+                               document.getElementById("blind-status").src = "res/blind-close-6.png";
+                               this.doorState = "closeState";
+                               this.autoControl = "true";
+                                               autoMode_on("on");
+                       } else if (rcsJsonString["doorState"] == "opened") {
+                               document.getElementById("blind-status").src = "res/blind-open-6.png";
+                               this.doorState = "openState";
+                               this.autoControl = "false";
+                                               autoMode_on("off");
+                       } else if (rcsJsonString["doorState"] == "opening") {
+                               document.getElementById("blind-status").src = "res/blind-open-6.png";
+                               this.doorState = "openState";
+                               this.autoControl = "true";
+                                               autoMode_on("on");
+                       } else if (rcsJsonString["doorState"] == "unknown") {
+                               document.getElementById("blind-status").src = "res/blind-close-6.png";
+                               //this.doorState = "unknown";
+                               this.doorState = "closeState";
+                               this.autoControl = "false";
+                                               autoMode_on("off");
+                       }
+               }
+       },
+       'set' : function(doorSet) {
+               scplugin.log.debug(className, arguments.callee.name, "doorState : " + doorSet);
+               var setRcsJson = {};
+               setRcsJson["doorState"] = doorSet;
+                       //setRcsJson["doorState"] = "opened";
+               ocfDevice.setRemoteRepresentation(this.href, setRcsJson, this.onRepresentCallback);
+       }
+}
+
+
+/*
+
+var capabilityDoorControl = {
+       'href' : "/capability/doorControl/main/0",
+       'state' : "closed",
+       'autoControl' : "false",
+
+       'update' : function() {
+               ocfDevice.getRemoteRepresentation(this.href, this.onRepresentCallback);
+       },
+
+       'onRepresentCallback' : function(result, deviceHandle, uri, rcsJsonString) {
+               scplugin.log.debug(className, arguments.callee.name, result);
+               scplugin.log.debug(className, arguments.callee.name, uri);
+
+               if (result == "OCF_OK" || result == "OCF_RESOURCE_CHANGED" || result == "OCF_RES_ALREADY_SUBSCRIBED") {
+               // document.getElementById("svg-status-id").innerHTML = rcsJsonString["doorState"];
+               // open, opening, closing, closed, unknown
+                       if (rcsJsonString["doorState"] == "closed") {
+                               document.getElementById("blind-status").src = "res/blind-close-6.png";
+                               //capabilityDoorControl.state = "closed";
+                       } else if (rcsJsonString["doorState"] == "closing") {
+                               document.getElementById("blind-status").src = "res/blind-close-6.png";
+                       //      capabilityDoorControl.state = "closing";
+                       } else if (rcsJsonString["doorState"] == "open") {
+                               document.getElementById("blind-status").src = "res/blind-open-6.png";
+                       //      capabilityDoorControl.state = "open";
+                       } else if (rcsJsonString["doorState"] == "opening") {
+                               document.getElementById("blind-status").src = "res/blind-open-6.png";
+                       //      capabilityDoorControl.state = "closed";
+                       } else if (rcsJsonString["doorState"] == "unknown") {
+                               document.getElementById("blind-status").src = "res/blind-close-6.png";
+                       //      capabilityDoorControl.state = "unknown";
+                       }
+               }
+       },
+
+       'set' : function(door_state) {
+               scplugin.log.debug(className, arguments.callee.name, "doorState : " + door_state;
+               var setRcsJson = {};
+               //setRcsJson["doorState"] = door_state;
+                               setRcsJson["doorState"] = "closed";
+               ocfDevice.setRemoteRepresentation(this.href, setRcsJson, this.onRepresentCallback);
+       },
+
+       'blind_dn_control' : function() {
+               this.set("closed");
+       },
+       'blind_up_control' : function() {
+               this.set("open");
+       },
+
+       'blind_auto_control' : function() {
+               //this.autoControl = !this.autoControl;
+               //alert("blind_auto_control.autoControl : " + this.autoControl);
+               if (capabilityDoorControl.autoControl == "true") {
+                       if (capabilityDoorControl.doorState == "open") {
+                               this.set("open");
+                       } else {
+                               this.set("closed");
+                       }
+                       capabilityDoorControl.autoControl == "false";
+               } else {
+                       if (capabilityDoorControl.doorState == "open") {
+                               this.set("opening");
+                       } else {
+                               this.set("closing");
+                       }
+                       capabilityDoorControl.autoControl = "true";
+               }
+       }
+}
+
+function auto_button_toggle() {
+       var element = document.getElementById("blind_auto_button"); //john
+       if (capabilityDoorControl.autoControl == "true") {
+               element.classList.add("cyan_back"); //john
+       } else {
+               element.classList.remove("cyan_back"); //john
+       }
+}
+*/
+/*
+var capabilityDoorControl = {
+       'href' : "/capability/doorControl/main/0",
+       'state' : "closeStatus",
+       'autoControl' : "false",
+
+       'update' : function() {
+               ocfDevice.getRemoteRepresentation(this.href, this.onRepresentCallback);
+       },
+
+       'onRepresentCallback' : function(result, deviceHandle, uri, rcsJsonString) {
+               scplugin.log.debug(className, arguments.callee.name, result);
+               scplugin.log.debug(className, arguments.callee.name, uri);
+
+               if (result == "OCF_OK" || result == "OCF_RESOURCE_CHANGED" || result == "OCF_RES_ALREADY_SUBSCRIBED") {
+               // document.getElementById("svg-status-id").innerHTML = rcsJsonString["doorState"];
+
+               // opening, closing : auto true - auto
+               // closed, opened, unknown : auto false - manual
+               // closing, opening, closed, open, unknown
+                       if (rcsJsonString["doorState"] == "closed") {
+                               capabilityDoorControl.state = "closeStatus";
+                               capabilityDoorControl.autoControl = "false";
+                       } else if (rcsJsonString["doorState"] == "closing") {
+                               capabilityDoorControl.state = "closeStatus";
+                               capabilityDoorControl.autoControl = "true";
+                       } else if (rcsJsonString["doorState"] == "open") {
+                               capabilityDoorControl.state = "openStatus";
+                               capabilityDoorControl.autoControl = "false";
+                       } else if (rcsJsonString["doorState"] == "opening") {
+                               capabilityDoorControl.state = "openStatus";
+                               capabilityDoorControl.autoControl = "true";
+                       } else //*if (rcsJsonString["doorState"] == "unknown")
+                         {
+                               capabilityDoorControl.state = "closeStatus";
+                               capabilityDoorControl.autoControl = "false";
+                       }
+
+                       if (capabilityDoorControl.autoControl == "true") { //-------------------------------------------
+                               if (capabilityDoorControl.state == "openStatus")
+                                       document.getElementById("blind-status").src = "res/blind-open-6.png";
+                               else
+                                       document.getElementById("blind-status").src = "res/blind-close-6.png";
+                       }
+               }
+       },
+       'set' : function(doorState) {
+               scplugin.log.debug(className, arguments.callee.name, "doorState : " + machineState);
+               var setRcsJson = {};
+               setRcsJson["doorState"] = doorState;
+               ocfDevice.setRemoteRepresentation(this.href, setRcsJson, this.onRepresentCallback);
+       }
+}
+*/
diff --git a/plugin/plugin/js/capability_illuminanceMeasurement.js b/plugin/plugin/js/capability_illuminanceMeasurement.js
new file mode 100644 (file)
index 0000000..05e63a0
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2015 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ var capabilityIlluminanceMeasurement = {
+       'href' : "/capability/illuminanceMeasurement/main/0",
+       'illuminance_value' : 0,
+
+       'update' : function() {
+               ocfDevice.getRemoteRepresentation(this.href, this.onRepresentCallback);
+       },
+
+       'onRepresentCallback' : function(result, deviceHandle, uri, rcsJsonString) {
+               scplugin.log.debug(className, arguments.callee.name, result);
+               scplugin.log.debug(className, arguments.callee.name, uri);
+
+               if (result == "OCF_OK" || result == "OCF_RESOURCE_CHANGED" || result == "OCF_RES_ALREADY_SUBSCRIBED") {
+                       this.illuminance_value = rcsJsonString["illuminance"];
+                       document.getElementById("illuminance").innerHTML = this.illuminance_value;
+                       //      document.getElementById("illuminance").innerHTML = rcsJsonString["illuminance"];
+
+                       //var nightLevel = 50;
+/*             var SelectedDoorState; */
+                       if (this.illuminance_value < 50) {
+                               //      if (capabilityDoorControl.autoControl == 1) SelectedDoorState = "closing";
+                               //      addClass(0);"
+                               document.getElementById("night").style.backgroundColor = "#3695dd";
+                               document.getElementById("cloudy").style.backgroundColor = "#fafafa";
+                               document.getElementById("sunny").style.backgroundColor = "#fafafa";
+                       } else if (this.illuminance_value < 1000) {
+                               //      if (capabilityDoorControl.autoControl == 1) SelectedDoorState = "opening";
+                               document.getElementById("night").style.backgroundColor = "#fafafa";
+                               document.getElementById("cloudy").style.backgroundColor = "#3695dd";
+                               document.getElementById("sunny").style.backgroundColor = "#fafafa";
+                               //      addClass(1)
+                       } else {
+                               //      if (capabilityDoorControl.autoControl == 1) SelectedDoorState = "opening";
+                               document.getElementById("night").style.backgroundColor = "#fafafa";
+                               document.getElementById("cloudy").style.backgroundColor = "#fafafa";
+                               document.getElementById("sunny").style.backgroundColor = "#3695dd";
+                               //      addClass(2)
+                       }
+
+               }
+       }
+
+}
+/*
+
+var capabilityIlluminanceMeasurement = {
+       'href' : "/capability/illuminanceMeasurement/main/0",
+       'illuminance_value' : 0,
+
+       'update' : function() {
+               ocfDevice.getRemoteRepresentation(this.href, this.onRepresentCallback);
+       },
+
+       'onRepresentCallback' : function(result, deviceHandle, uri, rcsJsonString) {
+               scplugin.log.debug(className, arguments.callee.name, result);
+               scplugin.log.debug(className, arguments.callee.name, uri);
+
+               if (result == "OCF_OK" || result == "OCF_RESOURCE_CHANGED" || result == "OCF_RES_ALREADY_SUBSCRIBED") {
+                       this.illuminance_value = rcsJsonString["illuminance"];
+                       document.getElementById("illuminance").innerHTML= this.illuminance_value;
+               }
+// if (value > 50)                     // day : 10,000 ~ 120k, night : ~ 50, overcast : 50 ~ 9999
+//                     SelectedDoorState = "open" ; else SelectedDoorState = "closed";
+
+               var SelectedDoorState;
+               //removeClass();
+               if (t//his.illuminance_value < 50) {
+               //      if (capabilityDoorControl.autoControl == 1) SelectedDoorState = "closing";
+               //      addClass(0);
+                       document.getElementById("night").style.backgroundColor: #3695dd;
+                       document.getElementById("cloudy").style.backgroundColor: #fafafa;
+                       document.getElementById("sunny").style.backgroundColor:  #fafafa;
+               } else if (this.illuminance_value < 1000) {
+               //      if (capabilityDoorControl.autoControl == 1) SelectedDoorState = "opening";
+                       document.getElementById("cloudy").style.backgroundColor: #fafafa;
+                       document.getElementById("night").style.backgroundColor: #3695dd;
+                       document.getElementById("sunny").style.backgroundColor: #fafafa;
+               //      addClass(1)
+               } else {
+               //      if (capabilityDoorControl.autoControl == 1) SelectedDoorState = "opening";
+                       document.getElementById("night").style.backgroundColor: #fafafa;
+                       document.getElementById("cloudy").style.backgroundColor: #fafafa;
+                       document.getElementById("sunny").style.backgroundColor: #3695dd;
+               //      addClass(2)
+               }
+               //capabilityDoorControl.set(SelectedDoorState);
+       }
+}
+*/
+/*
+function addClass(n) {
+       var element = document.getElementById("night");
+       element.classList.add("cyan_back");
+}
+
+function removeClass() {
+       var element = document.getElementById("night");
+       element.classList.remove("cyan_back");
+}
+*/
diff --git a/plugin/plugin/js/capability_switch.js b/plugin/plugin/js/capability_switch.js
new file mode 100644 (file)
index 0000000..1042219
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2015 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var capabilitySwitch = {
+       'href' : "/capability/switch/main/0",
+       'powerState' : "on",
+
+       'update' : function() {
+               ocfDevice.getRemoteRepresentation(this.href, this.onRepresentCallback);
+       },
+
+       'onRepresentCallback' : function(result, deviceHandle, uri, rcsJsonString) {
+               scplugin.log.debug(className, arguments.callee.name, result);
+               scplugin.log.debug(className, arguments.callee.name, uri);
+
+               if (result == "OCF_OK" || result == "OCF_RESOURCE_CHANGED" || result == "OCF_RES_ALREADY_SUBSCRIBED") {
+                       capabilitySwitch.powerState = rcsJsonString["power"];
+
+                       var image = document.getElementById("power_icon_back_circle");
+                       if (capabilitySwitch.powerState == "on") {
+                               image.style.background="#3695dd";
+                       image.style.opacity="1";
+                       } else {
+                               image.style.background="#252525";
+                       image.style.opacity="0.2";
+                       }
+               }
+       },
+
+       'set' : function(state) {
+               scplugin.log.debug(className, arguments.callee.name, "power : " + state);
+               var setRcsJson = {};
+               setRcsJson["power"] = state;
+               ocfDevice.setRemoteRepresentation(this.href, setRcsJson, this.onRepresentCallback);
+       },
+
+       'powerToggle' : function() {
+               if (this.powerState == "on") {
+                       this.set("off");
+               } else {
+                       this.set("on");
+               }
+       }
+}
diff --git a/plugin/plugin/js/index.js b/plugin/plugin/js/index.js
new file mode 100644 (file)
index 0000000..06e2e10
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2015 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ var ocfDevice;
+ var className = "AirConditioner";
+ var capabilities = [capabilitySwitch, capabilityIlluminanceMeasurement, capabilityDoorControl];
+
+ window.onload = function () {
+       console.log("version : 0.0.1");
+       init();
+
+       document.body.addEventListener('click', function () {
+               closeListBox();
+       })
+ };
+
+function init() {
+       console.log("-----------init-----------");
+       scplugin.manager.getOCFDevices(getOCFDeviceCB);
+}
+
+function getOCFDeviceCB(devices) {
+       console.log("getOCFDeviceCB : " + devices.length);
+
+       for (var i in devices) {
+               console.log("deviceHandle: " + devices[i].deviceHandle);
+               console.log("deviceName: " + devices[i].deviceName);
+               console.log("deviceType: " + devices[i].deviceType);
+               console.log("metadata: " + devices[i].metadata);
+       }
+
+       setMainDevice(devices[0]);
+       ocfDevice.subscribe(onRepresentCallback);
+
+       for (var i = 0; i < capabilities.length; i++) {
+               capabilities[i].update();
+       }
+}
+
+function onRepresentCallback(result, deviceHandle, uri, rcsJsonString) {
+       for (var i = 0; i < capabilities.length; i++) {
+               if ( capabilities[i].href == uri) {
+                       capabilities[i].onRepresentCallback(result, deviceHandle, uri, rcsJsonString);
+               }
+       }
+}
+
+function setMainDevice(device) {
+       scplugin.log.debug(className, arguments.callee.name, "set ocf device : " + device.deviceName);
+       ocfDevice = device;
+}
+
+function backAction() {
+       scplugin.manager.close();
+}
+
+function onPowerBtnClicked() {
+       capabilitySwitch.powerToggle();
+}
+/*
+function checkAutoMode() {
+       if (autoModeBool = 1) {
+               //checked;
+       }
+       else {
+       //unchecked;
+       }
+}
+*/
+function onSetBlindAutoModeClicked() {
+       if (capabilityDoorControl.autoControl == "false") {             //unchecked;
+               if (capabilityDoorControl.doorState == "openState")     capabilityDoorControl.set("opening");
+               else capabilityDoorControl.set("closing");
+               capabilityDoorControl.autoControl = "true";     // true;
+//             document.getElementById("autoMode").style.backgroundColor = "#3695dd";
+//             document.getElementById("autoMode").style.color = "white";
+//             document.getElementById("autoMode").style.borderColor = "#3695dd";
+//             document.getElementById("autoMode").value = "AUTO ON"
+               autoMode_on("on");
+       }
+       else {
+               if (capabilityDoorControl.doorState == "openState") capabilityDoorControl.set("opened");
+               else capabilityDoorControl.set("closed");
+               capabilityDoorControl.autoControl = "false";
+               autoMode_on("off");
+       //      document.getElementById("autoMode").style.backgroundColor = "white";
+//             document.getElementById("autoMode").style.color = "#b4b4b4";
+//             document.getElementById("autoMode").style.borderColor = "#b4b4b4";
+       //      document.getElementById("autoMode").value = "AUTO OFF"
+       }
+}
+
+function autoMode_on(onoff) {
+       var autoModeArea =      document.getElementById("autoMode");
+       if (onoff == "on") {
+               autoModeArea.style.backgroundColor = "#3695dd";
+               autoModeArea.style.color = "white";
+               autoModeArea.style.borderColor = "#3695dd";
+               autoModeArea.value = "AUTO ON";
+       } else {
+               autoModeArea.style.backgroundColor = "white";
+               autoModeArea.style.color = "#b4b4b4";
+               autoModeArea.style.borderColor = "#b4b4b4";
+               autoModeArea.value = "AUTO OFF";
+       }
+}
+//capabilityDoorControl.doorState == "closed" || capabilityDoorControl.doorState == "closed";
+/*     document.getElementById("cancel_button").style.visibility = "hidden";  "visible";
+                               document.getElementById("ready_text1").style.display = "inherit";
+                               document.getElementById("ready_text2").style.display = "inherit";
+                               document.getElementById("run_text1").style.display = "none";
+                               document.getElementById("run_text2").style.display = "none";
+                               document.getElementById("run_text3").style.display = "none";
+*/
+
+function onSetBlindUpDnClicked(updnValue) {
+// var pic;
+       var SelectedDoorState;
+        if (updnValue == 0) {
+               capabilityDoorControl.set("closed");
+               capabilityDoorControl.doorState = "closeState";
+       }
+       else {
+               capabilityDoorControl.set("opened");
+               capabilityDoorControl.doorState = "openState";
+       }
+//     event.stopPropagation();
+}
+
+function blind_up_Action() {
+       capabilityDoorControl.blind_up_control();
+}
+
+function blind_dn_Action() {
+       capabilityDoorControl.blind_dn_control();
+}
+
+function blind_auto_Action() {
+       //      auto_button_toggle();
+       capabilityDoorControl.blind_auto_control();
+}
diff --git a/plugin/plugin/manifest.xml b/plugin/plugin/manifest.xml
new file mode 100644 (file)
index 0000000..fe3d075
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+       <manifest xmlns="http://samsung.com/ns/plugin"
+                       manifestVersionCode="0"
+                       package="illOnly2door"
+                       versionCode="1"
+                       versionName="0.0.1"
+                       minPluginSdkVersion="1.0.0">
+
+               <plugin label="default.plugin" icon="icon.png" >
+                        <device type="none"
+                                subType="none"
+                                manufacturer="default.manufacturer"
+                                manufacturerID="default.manufacturer.id" />
+               </plugin>
+               <privilegeLevel level="public"/>
+       </manifest>
diff --git a/plugin/plugin/res/blind-close-6.png b/plugin/plugin/res/blind-close-6.png
new file mode 100644 (file)
index 0000000..65c2942
Binary files /dev/null and b/plugin/plugin/res/blind-close-6.png differ
diff --git a/plugin/plugin/res/blind-open-6.png b/plugin/plugin/res/blind-open-6.png
new file mode 100644 (file)
index 0000000..76ef73c
Binary files /dev/null and b/plugin/plugin/res/blind-open-6.png differ
diff --git a/plugin/plugin/res/board_ic_arrow_left.png b/plugin/plugin/res/board_ic_arrow_left.png
new file mode 100644 (file)
index 0000000..4c6118e
Binary files /dev/null and b/plugin/plugin/res/board_ic_arrow_left.png differ
diff --git a/plugin/plugin/res/ic_power.svg b/plugin/plugin/res/ic_power.svg
new file mode 100644 (file)
index 0000000..91f8202
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+        width="172px" height="172px" viewBox="0 0 172 172" enable-background="new 0 0 172 172" xml:space="preserve">
+<g>
+       <g>
+               <rect style="fill:#FFFFFF;" x="82.607" y="41.205" width="6.775" height="35.889"/>
+               <path style="fill:#FFFFFF;" d="M85.995,130.537c-24.247,0-43.973-19.745-43.973-44.014c0-17.017,9.964-32.673,25.385-39.886l2.87,6.137
+                       c-13.048,6.103-21.48,19.351-21.48,33.749c0,20.534,16.688,37.238,37.198,37.238c20.511,0,37.199-16.704,37.199-37.238
+                       c0-14.399-8.432-27.648-21.48-33.749l2.87-6.137c15.421,7.211,25.385,22.868,25.385,39.886
+                       C129.968,110.792,110.241,130.537,85.995,130.537z"/>
+       </g>
+</g>
+</svg>
diff --git a/plugin/plugin/res/icon-cloudy.png b/plugin/plugin/res/icon-cloudy.png
new file mode 100644 (file)
index 0000000..7794bbf
Binary files /dev/null and b/plugin/plugin/res/icon-cloudy.png differ
diff --git a/plugin/plugin/res/icon-night.png b/plugin/plugin/res/icon-night.png
new file mode 100644 (file)
index 0000000..4ee164a
Binary files /dev/null and b/plugin/plugin/res/icon-night.png differ
diff --git a/plugin/plugin/res/icon-sunny.png b/plugin/plugin/res/icon-sunny.png
new file mode 100644 (file)
index 0000000..0059b92
Binary files /dev/null and b/plugin/plugin/res/icon-sunny.png differ
diff --git a/plugin/plugin/res/lux.png b/plugin/plugin/res/lux.png
new file mode 100644 (file)
index 0000000..cd9cd58
Binary files /dev/null and b/plugin/plugin/res/lux.png differ
diff --git a/plugin/plugin/res/option_ic_more.svg b/plugin/plugin/res/option_ic_more.svg
new file mode 100644 (file)
index 0000000..3ea40c9
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+width="408px" height="408px" viewBox="0 0 408 408" style="enable-background:new 0 0 408 408;" xml:space="preserve" fill="#46a5ed">
+       <g>
+               <g id="more-vert">
+                       <path d="M204,102c28.05,0,51-22.95,51-51S232.05,0,204,0s-51,22.95-51,51S175.95,102,204,102z M204,153c-28.05,0-51,22.95-51,51
+                               s22.95,51,51,51s51-22.95,51-51S232.05,153,204,153z M204,306c-28.05,0-51,22.95-51,51s22.95,51,51,51s51-22.95,51-51
+                               S232.05,306,204,306z"/>
+               </g>
+       </g>
+</svg>