SmartApp: How do I access the definition data?


(fxstein) #1

Might be a stupid question:

How do I access the definition data from within the SmartApp and what other parameters are supported?

definition(
    name: "dummy",
    namespace: "fxstein",
    author: "Oliver",
    description: "Just so we can lookup examples... :-(",
    category: "My Apps",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")

I know SmartThings is also doing internal versioning, would need to get the version number in addition to the above data plus anything else that can be exposed about this instance of an App.

Thanks!


(fxstein) #2

Ok - did some debugging for some of the objects we have access to, especially around app, location and event (for now).

For what its worth here is what I found (not all I was hoping for but a start):

app=physicalgraph.app.InstalledSmartAppWrapper@2ead092

properties=
[appSettings:[:], 
showEasingCards:null, 
virtualDevices:[], 
id:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx, 
eventService:physicalgraph.event.EventService@72614c60, 
installedSmartApp:Sync Nest Mode, 
deviceService:physicalgraph.device.DeviceService@15d7cb20, 
name:Sync Nest Mode, 
subscriptions:[physicalgraph.app.EventSubscriptionWrapper@a58ad14,
physicalgraph.app.EventSubscriptionWrapper@43cb015a], 
childDevices:[], 
namespace:fxstein, 
class:class physicalgraph.app.InstalledSmartAppWrapper, 
executionIsModeRestricted:false, installedSmartAppService:physicalgraph.app.InstalledSmartAppService@532479a8, 
accountId:xxxxxxxxxxxxxxxxxxxxxxxxxxxx, 
installationState:COMPLETE, 
label:Sync Nest Mode, 
childApps:[], 
executableModes:[], 
parent:physicalgraph.app.InstalledSmartAppWrapper@46464da1]

Gets me to name and namespace, but the version info I was looking for is absent in the app itself.Have not had the chance to traverse all possible objects.