diff --git a/src/ui/Domo/src/components/Light.vue b/src/ui/Domo/src/components/Light.vue
index 4ceed585..a4d9e0bc 100644
--- a/src/ui/Domo/src/components/Light.vue
+++ b/src/ui/Domo/src/components/Light.vue
@@ -5,7 +5,7 @@
{{inlineDesc}}
-
+
@@ -27,27 +27,19 @@ export default {
}
},
props: {
- title: {
- type: String,
- required: true
- },
data: {},
disabled: {
type: Boolean,
default: false
},
- value: {
- type: Boolean,
- twoWay: true
- },
inlineDesc: {
type: String
}
},
ready: function () {},
watch: {
- value: function (newVal) {
- this.$dispatch('on-change', newVal)
+ 'data.state': function (newState) {
+ this.$dispatch('on-change', this.data)
}
}
}
diff --git a/src/ui/Domo/src/components/Lights.vue b/src/ui/Domo/src/components/Lights.vue
index d5e43f00..aa0dc077 100644
--- a/src/ui/Domo/src/components/Lights.vue
+++ b/src/ui/Domo/src/components/Lights.vue
@@ -1,11 +1,7 @@
Lights
-
-
-
+
@@ -33,9 +29,7 @@ export default {
Light
},
methods: {
- change (e) {
- console.log(e)
- },
+ /* Get Lights */
getLights () {
this.$http.get('http://192.168.1.6:8081/v1/capabilities/lights')
.then(function (response) {
@@ -44,64 +38,21 @@ export default {
}, function (err) {
console.log(err)
})
+ },
+ /* Set Light */
+ setLight (data) {
+ var msg = ''
+ console.log(data)
+ msg = '{"id": ' + data.id + ', "state": ' + data.state + '}'
+ console.log(msg)
+ this.$http.post('http://192.168.1.6:8081/v1/capabilities/lights', msg)
+ .then(function (response) {
+ console.log('Success!:', response.data)
+ }, function (err) {
+ console.log(err)
+ })
}
}
}
-