initial import(release):plugin 48/185148/4
authorjohnny nam <johnny@dignsys.com>
Thu, 26 Jul 2018 08:26:56 +0000 (17:26 +0900)
committerscott park <scott.park@dignsys.com>
Wed, 12 Sep 2018 13:50:08 +0000 (22:50 +0900)
Change-Id: Ib96f3e9adb50b6b193ade45da004063d0132280a
Signed-off-by: scott park <scott.park@dignsys.com>
18 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-illuminance.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_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/board_ic_arrow_left.png [new file with mode: 0644]
plugin/plugin/res/bulb0s.png [new file with mode: 0644]
plugin/plugin/res/bulb1s.png [new file with mode: 0644]
plugin/plugin/res/bulb2s.png [new file with mode: 0644]
plugin/plugin/res/ic_power.svg [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..7cc6767
--- /dev/null
@@ -0,0 +1,21 @@
+{
+       "items": [
+               {
+                       "name": "illlOnly",
+                       "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..cae94c6
--- /dev/null
@@ -0,0 +1,21 @@
+{
+       "name": "illuonly",
+       "components": [
+               {
+                       "id": "main",
+                       "capabilities": [
+                               {
+                                       "id": "switch"
+                               },
+                               {
+                                       "id": "illuminanceMeasurement"
+                               }
+                       ]
+               }
+       ],
+       "metadata": {
+               "mnmn": "",
+               "vid": "illuOnly",
+               "deviceType": "Blind"
+       }
+}
\ No newline at end of file
diff --git a/plugin/manifest/ui.json b/plugin/manifest/ui.json
new file mode 100644 (file)
index 0000000..d97e7db
--- /dev/null
@@ -0,0 +1,246 @@
+{
+       "n": "illuonly",
+       "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"
+                               }
+                       ],
+                       "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://illuOnly"
+               },
+               {
+                       "os": "ios",
+                       "dpType": "vendorPlugIn",
+                       "dpUri": "wwst://illuOnly"
+               }
+       ],
+       "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"
+               }
+       ]
+}
\ 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-illuminance.css b/plugin/plugin/css/sensor-illuminance.css
new file mode 100644 (file)
index 0000000..cddd90c
--- /dev/null
@@ -0,0 +1,124 @@
+#illuminance_status_area {
+       margin-top: 15px;
+       margin-left: auto;
+       margin-right: auto;
+       width: 285px; // width: 70%;
+//     height: auto;
+ // height: 20%;
+       position: relative;
+       text-align: center;
+       color: white;
+       font-size: 25px;
+       background-color: #ededed;
+       padding: 10px 0px 5px 0px;
+}
+
+#illuminance_status {
+width: 80%;
+       height: auto; // height: 20%;
+}
+
+#illuminance_status_area_text {
+       position: absolute;
+       top: 45%;
+       left: 40%;
+       font-size: 16px;
+       padding: 5px;
+       color: black;
+}
+
+.measure_container {
+       margin-top: 12px;
+       text-align: center;
+       padding-top: 3px;
+       width: 285px;
+       margin-left: auto;
+       margin-right: auto; }
+
+.illuminance_value_wrap {
+       width: 100%;
+       padding: 10px 0px;
+       height: 80px;
+       display: inline-block;
+       background-color: #3695dd;
+       color: white;
+       border: none;
+}
+.illuminance_value_item {
+       text-align: left;
+       font-size: 36px;
+       color: white;
+}
+
+#sensor_unit {
+       font-size: 24px;
+       text-align: left;
+       vertical-align: medium;
+       line-height: 23px;
+       }
+
+.illuminance_value_title {
+       padding: 5px;
+}
+.illuminance_value {
+       padding: 6px;
+}
+
+.status-container {
+       margin-top: 7px;
+       padding: 8px 0px;
+}
+
+table, td {
+       border-collapse: collapse;
+       font-weight: midium;
+       font-size: 15px;
+}
+
+table {
+       float: center;
+       width: 295px;
+       background-color: #ededed;
+}
+td {
+       width: 95px !important;
+       text-align: center;
+       border-right: solid #fafafa 8px;
+}
+
+.svg-class-illu {
+  width: auto;
+       height: 40px;
+       vertical-align: top;
+       border-top: none;
+       padding: 0px 0px 10px 0px;
+}
+.svg-class-illu-desc {
+  height: 15px;
+       vertical-align: bottom;
+       border-bottom: none;
+       padding: 10px 0px 3px 0px;
+}
+#illuminance_desc {
+height: 80px;}
+
+span { display: inline-block; vertical-align: middle; }
+
+.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; }
+.underline80 {
+       border-bottom: 1px solid #fafafa;
+       text-align: center;
+       width: 70%;
+       margin-left: auto;
+       margin-right: auto; }
+
diff --git a/plugin/plugin/css/style.css b/plugin/plugin/css/style.css
new file mode 100644 (file)
index 0000000..69d1275
--- /dev/null
@@ -0,0 +1,377 @@
+@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: 5px 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: 100px;
+}
+
+#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: 30px;
+  width: 200px;
+  border: 2px solid #3695dd;
+}
+
+.mode_bar_text {
+  color: #3695dd;
+  font-size: 17px;
+  text-align-last:center;
+}
+
+.status-container {
+       text-align:center;
+       margin-bottom:0px;
+}
+
+.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%;
+}
+
+@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..676d810
--- /dev/null
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html lang="ko">
+       <head>
+               <title>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-illuminance.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_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">Illuminance</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">Illuminance</div>
+                       </div>
+                       <!--    <div class="status_sub_bar roboto-condensed-regular">INDOOR</div>       -->
+                       <!-- illuminance status display area -->
+                       <div id="illuminance_status_area" class="roboto-condensed-regular">
+                               <img id="illuminance_status" src="res/bulb0s.png"/>
+                               <div id="illuminance_status_area_text"></div>
+                       </div>
+                       <div class="measure_container">
+                               <!-- sensor value display area -->
+                               <div class="illuminance_value_wrap roboto-regular">
+                                       <div class="illuminance_value_title underline80">Illuminance Value</div>
+                                       <div class="illuminance_value">
+                                               <span class="illuminance_value_item roboto-condensed-bold" id="illuminance_value">12,000</span>
+                                               <span class="illuminance_value_item roboto-regular" id="sensor_unit">&nbsp;LUX</span>
+                                       </div>
+                               </div>
+                               <!-- status description -->
+                               <div class="status-container">
+                                       <table id="illuminance_desc" align="center">
+                                               <tr> <td class="svg-class-illu-desc roboto-regular">dark</td>
+                                                       <td class="svg-class-illu-desc roboto-regular">overcast</td>
+                                                       <td class="svg-class-illu-desc roboto-regular">bright</td>
+                                               </tr>
+                                               <tr> <td><img class="svg-class-illu" id="svg_night" src="res/bulb2s.png"></td>
+                                                       <td><img class="svg-class-illu" id="svg_overcast" src="res/bulb1s.png"/></td>
+                                                       <td><img class="svg-class-illu" id="svg_bright" src="res/bulb0s.png"></td>
+                                               </tr>
+                                       </table>
+                               </div>
+                       </div>
+               </div>
+       </body>
+</html>
diff --git a/plugin/plugin/js/capability_illuminanceMeasurement.js b/plugin/plugin/js/capability_illuminanceMeasurement.js
new file mode 100644 (file)
index 0000000..b125446
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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_value").innerHTML = this.illuminance_value;
+
+                       if (this.illuminance_value < 50) {
+                               document.getElementById("illuminance_status").src = "res/bulb2s.png";
+                               document.getElementById("illuminance_status_area_text").innerHTML = ""; //"dark";
+                       }
+                       else if (this.illuminance_value < 1000) {
+                               document.getElementById("illuminance_status").src = "res/bulb1s.png";
+                               document.getElementById("illuminance_status_area_text").innerHTML = ""; //"overcast";
+                       }
+                       else {
+                               document.getElementById("illuminance_status").src = "res/bulb0s.png";
+                               document.getElementById("illuminance_status_area_text").innerHTML = ""; //"bright";
+                       }
+                       //alert("illuminance_value : " + this.illuminance_value);
+               }
+       }
+}
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..ea0d610
--- /dev/null
@@ -0,0 +1,89 @@
+
+/*
+ * 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 = "illuminanceMeter";
+var capabilities = [capabilitySwitch, capabilityIlluminanceMeasurement];
+
+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 closeListBox(event) {
+       // var x1 = event.offsetLeft;
+       // var y1 = event.offsetTop;
+       // var x2 = event.offsetWidth;
+       // var y2 = event.offsetHeight;
+       // var x = event.onmouseout.arguments["0"].clientX;
+       // var y = event.onmouseout.arguments["0"].clientY;
+       // if(x < x1 || x > x1+x2)
+       //      capabilityFanspeed.closeListbox();
+       // else if(y < y1 || y > y1+y2)
+       if (document.getElementById("listbox").classList.contains('show')) {
+               capabilityFanspeed.closeListbox();
+       }
+}
+
diff --git a/plugin/plugin/manifest.xml b/plugin/plugin/manifest.xml
new file mode 100644 (file)
index 0000000..fdc0f3b
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+       <manifest xmlns="http://samsung.com/ns/plugin"
+                       manifestVersionCode="0"
+                       package="illuOnly"
+                       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/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/bulb0s.png b/plugin/plugin/res/bulb0s.png
new file mode 100644 (file)
index 0000000..192f384
Binary files /dev/null and b/plugin/plugin/res/bulb0s.png differ
diff --git a/plugin/plugin/res/bulb1s.png b/plugin/plugin/res/bulb1s.png
new file mode 100644 (file)
index 0000000..2f7bb8b
Binary files /dev/null and b/plugin/plugin/res/bulb1s.png differ
diff --git a/plugin/plugin/res/bulb2s.png b/plugin/plugin/res/bulb2s.png
new file mode 100644 (file)
index 0000000..43485fe
Binary files /dev/null and b/plugin/plugin/res/bulb2s.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/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>