diff --git a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy index b3331d7945b..67a1f92fd3a 100755 --- a/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy +++ b/devicetypes/smartthings/zigbee-window-shade.src/zigbee-window-shade.groovy @@ -11,6 +11,7 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations under the License. */ +import groovy.json.JsonOutput import physicalgraph.zigbee.zcl.DataType metadata { @@ -82,9 +83,20 @@ private List collectAttributes(Map descMap) { return descMaps } +def installed() { + log.debug "installed" + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"])) +} + // Parse incoming device messages to generate events def parse(String description) { log.debug "description:- ${description}" + + // update existing devices + if (!state.supportedWindowShadeCommands) { + sendEvent(name: "supportedWindowShadeCommands", value: JsonOutput.toJson(["open", "close", "pause"])) + } + if (description?.startsWith("read attr -")) { Map descMap = zigbee.parseDescriptionAsMap(description) if (isBindingTableMessage(description)) {