Skip to content

Commit

Permalink
issue_859 (#860)
Browse files Browse the repository at this point in the history
* array and method should not have the same name

changing array references to new name

taking out unused getter

* changing to v-show
  • Loading branch information
paulr34 authored Dec 16, 2022
1 parent 1f2169e commit 268ac00
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions src/components/ZclCreateModifyEndpoint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ limitations under the License.
min="0"
/>
<q-input
v-if="$store.state.zap.isProfileIdShown"
v-show="$store.state.zap.isProfileIdShown"
label="Profile ID"
v-model="computedProfileId"
ref="profile"
Expand All @@ -52,7 +52,7 @@ limitations under the License.
hide-selected
fill-input
:options="deviceTypeOptions"
v-model="deviceTypeRefAndDeviceIdPair"
v-model="devicePair"
:rules="[(val) => val != null || '* Required']"
:option-label="getDeviceOptionLabel"
@filter="filterDeviceTypes"
Expand Down Expand Up @@ -141,7 +141,7 @@ export default {
this.shownEndpoint.deviceVersion = parseInt(
this.endpointVersion[this.endpointReference]
)
this.deviceTypeRefAndDeviceIdPair = {
this.devicePair = {
deviceTypeRef:
this.endpointDeviceTypeRef[this.endpointType[this.endpointReference]],
deviceIdentifier: this.endpointDeviceId[this.endpointReference],
Expand Down Expand Up @@ -213,11 +213,6 @@ export default {
return this.$store.state.zap.endpointView.deviceId
},
},
deviceTypeRefAndDeviceIdPair: {
get() {
return this.$store.state.zap.deviceTypeRefAndDeviceIdPair
},
},
computedProfileId: {
get() {
let profileOption =
Expand Down Expand Up @@ -262,9 +257,8 @@ export default {
profileId = this.asHex(this.zclDeviceTypes[deviceTypeRef].profileId, 4)
}
this.shownEndpoint.profileIdentifier = profileId
this.deviceTypeRefAndDeviceIdPair.deviceTypeRef = value.deviceTypeRef
this.deviceTypeRefAndDeviceIdPair.deviceIdentifier =
value.deviceIdentifier
this.devicePair.deviceTypeRef = value.deviceTypeRef
this.devicePair.deviceIdentifier = value.deviceIdentifier
},
saveOrCreateHandler() {
let profile = this.$store.state.zap.isProfileIdShown
Expand Down Expand Up @@ -308,7 +302,7 @@ export default {
this.$store
.dispatch(`zap/addEndpointType`, {
name: 'Anonymous Endpoint Type',
deviceTypeRef: this.deviceTypeRefAndDeviceIdPair.deviceTypeRef,
deviceTypeRef: this.devicePair.deviceTypeRef,
})
.then((response) => {
this.$store
Expand All @@ -318,8 +312,7 @@ export default {
profileId: parseInt(this.shownEndpoint.profileIdentifier),
endpointType: response.id,
endpointVersion: this.shownEndpoint.deviceVersion,
deviceIdentifier:
this.deviceTypeRefAndDeviceIdPair.deviceIdentifier,
deviceIdentifier: this.devicePair.deviceIdentifier,
})
.then((res) => {
if (this.shareClusterStatesAcrossEndpoints()) {
Expand Down Expand Up @@ -362,7 +355,7 @@ export default {
this.$store.dispatch('zap/updateEndpointType', {
endpointTypeId: endpointTypeReference,
updatedKey: RestApi.updateKey.deviceTypeRef,
updatedValue: this.deviceTypeRefAndDeviceIdPair.deviceTypeRef,
updatedValue: this.devicePair.deviceTypeRef,
})
this.$store.dispatch('zap/updateEndpoint', {
Expand All @@ -386,7 +379,7 @@ export default {
},
{
updatedKey: RestApi.updateKey.deviceId,
value: parseInt(this.deviceTypeRefAndDeviceIdPair.deviceIdentifier),
value: parseInt(this.devicePair.deviceIdentifier),
},
],
})
Expand Down Expand Up @@ -434,8 +427,8 @@ export default {
try {
done(
{
deviceTypeRef: this.deviceTypeRefAndDeviceIdPair.deviceTypeRef
? this.deviceTypeRefAndDeviceIdPair.deviceTypeRef
deviceTypeRef: this.devicePair.deviceTypeRef
? this.devicePair.deviceTypeRef
: this.customDeviceIdReference,
deviceIdentifier: parseInt(val),
},
Expand Down

0 comments on commit 268ac00

Please sign in to comment.