Add mqtt publish for light values.

This commit is contained in:
Andrés Uribe Stengel 2020-07-24 20:41:30 +02:00
parent 56b593e9e8
commit 399ffeae83

View File

@ -76,7 +76,7 @@ export default function Settings() {
Meteor.call('mqttPublish', {
topic: 'smartgarden/commands/' + selectedEspId + '/automatic',
payload: JSON.stringify({
'irrigation': "true",
'irrigation': 'true',
'light': 'true'
})
}, (err, res) => {
@ -86,6 +86,20 @@ export default function Settings() {
alert('success')
}
})
Meteor.call('mqttPublish', {
topic: 'smartgarden/commands/' + selectedEspId + '/light',
payload: JSON.stringify({
'minLX': 500,
'nm': 700
})
}, (err, res) => {
if (err) {
alert(err);
} else {
alert('success')
}
})
}
}