Premise users run the risk of becoming Premise addicts. For example, this morning I woke up and the first thing I had to do was post why my idea may not work properly!
The DateTime area is refreshed every minute by a timer. This use of polling is not used by the other elements of Premise Browser; most of its elements subscribe to changes in properties ... alter a property and its visual representation is automatically altered in Premise Browser.
Putting the external temperature reading, and the weather image, in DateTime is a good choice because the entire area gets redrawn every minute. However, the Shortcuts area is not periodically refreshed ... it uses subscription
For subscription to work, the property has to change in order to trigger a transaction. So if you change the name of the file in BackgroundImage, that is a significant modification and Premise Browser will be updated. However, if you simply change the image file's content (i.e. the file name stays the same) that is not a significant change to the BackgroundImage property and nothing will be refreshed in the browser.
One solution may be to use SetValueForced
to write to the BackgroundImage
property (each time you need to update the weather image). It causes Premise to evaluate a property even if the property's value has not changed significantly. For example, if a light's PowerState
is currently True
, setting it to True again will not cause Premise to evaluate it (i.e. no transactions will be executed). However, if you use this.SetValueForced "PowerState", True
it will force Premise to evaluate the property and trigger a transaction.Addendum
is thwarted by Internet Explorer!
I ran a test. I changed the image file's content and altered the CSS to move the image's position (background-position:center). The result is that the image moves from right-justified to centered (yay!) but the image content is unchanged (boo!). Why? Because IE caches
the image file! Altering IE's handling of caching "Tools > Internet Options > (Browsing History) Settings > (Check for newer versions of stored pages) Every time I visit the page" doesn't fix it. Premise Browser employs an AJAX-like technology that refreshes portions of the web page
and not the whole page
I think you'll have to shoehorn the image into the DateTime area. The only other solution would be to alter AutomationBrowser and create a new Component (i.e. a new permanent element in the Premise Browser's UI). I've experimented with this in the past and created a Status bar at the bottom of the screen. But it creates a compatibility problem ... like the Environment Canada Weather module I wrote, but haven't shared, because it demands the 1024x768 version of AutomationBrowser.
Edited by 123, 22 March 2009 - 09:30 AM.