Morning all.
I am working with @gmhanna on a THR project, and one of the requirements is for the Tablet to be “location aware” - in other words to know where it is, and therefore have some visibility or controls restricted based on what room the tablet is installed into.
I have created a new Plugin and Device called “ContextAware” that has the capability of Location, so we can hold a string that defines the location, and so the setting can be persistent between launches/reboots and so on, and be specific to the Tablet as it is set through the settings page. It works great.
BUT - we’d like to be a little more creative… we’d like to detect if the Location is not set on launch, and have the user set the location INTO the Device Setting (to allow it to be persistent). And then under a PIN number, we’d like the ability for an admin user to be able to change the Location Setting at Run Time.
But I think we have a problem that the Device Settings cannot be written at Run Time… only through the Designer, or by using the Settings Page on the Tablet… What I think we want is a function like App.SetDeviceAttribute that is more like App.SetDeviceSetting to allow us to change a device setting at Run Time.
I know that another way to achieve the persistence we want is to move the variable off the device and into a Raspberry Pi or something running some Python or something that would allow our Tablet to read/write its own location using an external device, but it would be neater if we could set the device settings at run time in a script.
Are we barking up the wrong tree, or is there a solution to this ?
thanks