Wappsto / javascript-wappsto-wapp

A JavaScript API for the Wappsto Wapp
MIT License
4 stars 1 forks source link

Remove state if the permission value is changed #167

Closed StefanoMartin closed 1 year ago

StefanoMartin commented 1 year ago

If a value change from "rw" to "r", remove the Control state.

BEFORE:

this.chargeTimeFull = await device.createValue({
      name: 'time_of_full_charge',
      permission: 'rw',
      template: Wappsto.ValueTemplate.NUMBER
    })

Expected 2 states, found 2 states

AFTER

this.chargeTimeFull = await device.createValue({
      name: 'time_of_full_charge',
      permission: 'r',
      template: Wappsto.ValueTemplate.NUMBER
    })

Expected 1 state, found 2 states