From 5b43aa3356fa5fd83ab6f2cee9d146bff31a7ebc Mon Sep 17 00:00:00 2001 From: c steele Date: Sat, 23 Dec 2023 00:20:10 -0800 Subject: [PATCH] v0.4.4 --- GetAttributesApp.groovy | 67 +++++------------------------------------ 1 file changed, 8 insertions(+), 59 deletions(-) diff --git a/GetAttributesApp.groovy b/GetAttributesApp.groovy index 7bf8392..e1283eb 100644 --- a/GetAttributesApp.groovy +++ b/GetAttributesApp.groovy @@ -1,5 +1,5 @@ /** - * IMPORT URL: https://raw.githubusercontent.com/HubitatCommunity/GetAttributeApp/master/GetAttributesApp.groovy + * IMPORT URL: https://raw.githubusercontent.com/HubitatCommunity/GetAttributesApp/master/GetAttributesApp.groovy * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at: @@ -11,7 +11,13 @@ * * */ - public static String version() { return "v0.4.2" } + +/* + * csteele v0.4.4 Remove updateCheck() - let HPM check for an update. + * + */ + + public static String version() { return "v0.4.4" } definition( @@ -164,67 +170,10 @@ def initialize() Notes: Not very exciting. */ def display() { - updateCheck() section{ paragraph "\n
" paragraph "
Developed by: C Steele
Version Status: $state.Status
Current Version: ${version()} - ${thisCopyright}
" } } - -// Check Version ***** with great thanks and acknowledgment to Cobra (CobraVmax) for his original code **** -def updateCheck() -{ - def paramsUD = [uri: "https://hubitatcommunity.github.io/GetAttributeApp/version2.json"] - - asynchttpGet("updateCheckHandler", paramsUD) -} - -def updateCheckHandler(resp, data) { - - state.InternalName = "GetAttributesApp" - - if (resp.getStatus() == 200 || resp.getStatus() == 207) { - respUD = parseJson(resp.data) - //log.warn " Version Checking - Response Data: $respUD" // Troubleshooting Debug Code - Uncommenting this line should show the JSON response from your webserver - state.Copyright = "${thisCopyright}" - // uses reformattted 'version2.json' - def newVerRaw = (respUD.application.(state.InternalName).ver) - def newVer = (respUD.application.(state.InternalName).ver.replaceAll("[.vV]", "")) - def currentVer = version().replaceAll("[.vV]", "") - state.UpdateInfo = (respUD.application.(state.InternalName).updated) - def author = (respUD.author) - // log.debug "updateCheck: $newVerRaw, $state.UpdateInfo, $author" - - if(newVer == "NLS") - { - state.Status = "** This Application is no longer supported by $author **" - log.warn "** This Application is no longer supported by $author **" - } - else if(currentVer < newVer) - { - state.Status = "New Version Available (Version: $newVerRaw)" - log.warn "** There is a newer version of this Application available (Version: $newVerRaw) **" - log.warn "** $state.UpdateInfo **" - } - else if(currentVer > newVer) - { - state.Status = "You are using a Test version of this Application (Expecting: $newVerRaw)" - } - else - { - state.Status = "Current" - state.UpdateInfo = "n/a" - if (descTextEnable) log.info "You are using the current version of this Application" - } - - sendEvent(name: "verUpdate", value: state.UpdateInfo) - sendEvent(name: "verStatus", value: state.Status) - } - else - { - log.error "Something went wrong: CHECK THE JSON FILE AND IT'S URI" - } -} - def getThisCopyright(){"© 2019 C Steele "}