Skip to content

Commit

Permalink
fix: Force using JSON payload when HassDiscovery is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 24, 2020
1 parent fe9511e commit 72d202b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@
v-model="gateway.payloadType"
label="Payload type"
required
:rules="[validPayload]"
:items="py_types"
></v-select>
</v-flex>
Expand Down Expand Up @@ -477,6 +478,9 @@ export default {
(this.mqtt.auth && !!this.mqtt.username) || 'This field is required.'
)
},
validPayload () {
return (!this.gateway.hassDiscovery || this.gateway.payloadType !== 2) || 'Hass discovery doesn\'t works with this payload type'
},
requiredPassword () {
return (
(this.mqtt.auth && !!this.mqtt.password) || 'This field is required.'
Expand Down

0 comments on commit 72d202b

Please sign in to comment.