Smart Home Action Setting "mode" for thermostat doesn't reflect in UI - actions-on-google

I have a smart home action with Thermostats. The available modes are 'on' 'off' 'heat' 'cool'. Heat and cool work fine. It's just the on/off modes that aren't working properly.
When I select the "Off" mode, it continues to show the UI as if its still in heat/cool mode as shown in the following screen shot:
https://photos.app.goo.gl/snG1hGR4y9Jb7uTi8
However if I were to look at other thermostats available from other manufacturers like Zen, it properly shows the off mode UI:
https://photos.app.goo.gl/VfeY75Bf12FLuTiaA
I can confirm Nest thermostats also display correctly. I'm just wondering what I'm doing wrong. I have verified that my home graph has updated correctly with the mode as shown in the following:
https://photos.app.goo.gl/FNvcftibihxL8uFM8
I've even tried setting a hidden field called activethermostatmode that isn't documented. Addtionally what is the 'on' mode for if you can't select it in the drop down for selecting thermostat modes in the google home app.

The UI behavior on Google Home App and the display devices are dependent on the information which comes from Report State as well as the QUERY responses. The UI will not work properly if either of the two hasn’t been implemented correctly.
You can confirm if you have implemented both correctly using Test Suite: https://smarthome-test-suite.withgoogle.com/

Related

all widgets in my app doesn't showing when I enter the app the seconde time

I dont know how exactly describe my problem ,my app works well
it show like this and works fine
but when I enter to it in the second time it show like this
!
enter image description here
and it's still working, its just not showing things as it should
I'm using getx as state management and I'm using it to change theme(dark,light) and the language(english,Arabic)
I dont know even what causes the issue so please help me with any think
I try to change the default language and theme and it's the same issue
when I face the issue I press the back button to be out of the app and I enter the app again( without removing it from background) it work and everything fine

Restart MKUserTrackingMode.FollowWithHeading

Code:
map.UserTrackingMode = MKUserTrackingMode.FollowWithHeading;
But after a user interacts with the map or after mKMapView.ShowAnnotations, the map automatically stops following the device's heading. (Not by my code. That's just how mkmapview works. This is also the case in the built in Maps app.)
How can I make the map start following the device's heading again from code?
This is exactly like how the Maps app works and is what the user will expect. The behavior you're describing is completely normal; you shouldn't interfere with it.
The usual thing is that you put an MKUserTrackingButton in the interface, associated with the map view, and the user can just tap it to switch modes automatically. Except for initially configuring the button, no code is needed.
https://developer.apple.com/documentation/mapkit/mkusertrackingbutton
or
https://developer.apple.com/documentation/mapkit/mkusertrackingbarbuttonitem

How to prevent orientation changes in windows phone 8.1 apps

I have a Windows Phone 8.1 app that in most of the pages requires (ok, allows) orientation changes to happen (by handling changes using visual state manager), but I have some of the pages where I want to disable the orientation change to happen.
How can I disable the orientation change for these pages? There is no SupportedOrientations property for the Page anymore (like in WP 8).
To change the supported orientation, use the DisplayInformation.AutoRotationPreferences property:
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
Note that this property is global, and not set just on the page like it was on previous versions of Windows Phone. If you want to apply the change to only one page, override the OnNavigatedTo event and set the value there. Just don't forget to restore the previous value when the user leaves the page, either using OnNavigatedFrom or the OnNavigatedTo event of the next page.

Addon SDK way to make a dialog

What is the proper way to use the SDK to make a dialog (which is not anchored to the add-on bar, etc. but shows centered on screen)? It doesn't seem like there is any API for this important capability. I do see windows/utils has open but I have two problems with that:
The dialog opening seems to require "chrome" privs to get it to be centered on the screen (and I'd be expectant of add-on reviewers complaining of chrome privs, and even if not, I'd like to try to stick to the SDK way).
While I can get the DOM window reference of the new window/utils' open() dialog, I'm not sure how to attach a content script so I can respond to user interaction in a way that prompts (and can respond to) privileged behavior ala postMessage or port.emit (without again, directly working with chrome privs).
Ok, this answer should have been pretty obvious for anyone with a little experience with the SDK. I realized I can just use a panel. In my defense, the name "panel" is not as clear as "dialog" in conjuring up this idea, and I am so used to using panels with widgets, that it hadn't occurred to me that I could use it independently!
Edit
Unfortunately, as per Bug 595040, these dialogs are not persistent, meaning if the panel loses focus, the "dialog" is gone... So panel looks like it is not a suitable candidate after all... :(
Edit 2
I've since moved on and have gotten things working mostly to my satisfaction with sdk/window/utils and openDialog on whose returned window I add a load listener and then call tabs.activeTab.on('ready', and then set tabs.activeTab.url to my add-on local HTML file so the ready event will get a tab to which I can attach a worker. There is still the problem with chrome privs I suppose, but at least the main communications are using SDK processes.
Update to Edit 2:
Code sample provided by request:
var data = require('sdk/self').data,
tabs = require('sdk/tabs');
var win = require('sdk/window/utils').openDialog({
// No "url" supplied here in this case as we add it below (in order to have a ready listener in place before load which can give us access to the tab worker)
// For more, see https://developer.mozilla.org/en-US/docs/Web/API/window.open#Position_and_size_features
features: Object.keys({
chrome: true, // Needed for centerscreen per docs
centerscreen: true, // Doesn't seem to be working for some reason (even though it does work when calling via XPCOM)
resizable: true,
scrollbars: true
}).join() + ',width=850,height=650',
name: "My window name"
// parent:
// args:
});
win.addEventListener('load', function () {
tabs.activeTab.on('ready', function (tab) {
var worker = tab.attach({
contentScriptFile: ....
// ...
});
// Use worker.port.on, worker.port.emit, etc...
});
tabs.activeTab.url = data.url('myHTMLFile.html');
});
if the panel loses focus, the "dialog" is gone...
It doesn't get destroyed, just hides, right? If so, depending on why it's getting hidden, you can just call show() on it again.
You'd want to make sure it's not being hidden for a good reason before calling show again. If there's a specific situation in which it's losing focus where you don't want it to, create a listener for that situation, then call if (!panel.isShown) panel.show();
For example, if it's losing focus because a user clicks outside the box, then that's probably the expected behaviour and nothing should be done. If it's losing focus when the browser/tab loses focus, just register a tab.on('activate', aboveFunction)
Simply adding ",screenX=0,screenY=0" (or any values, the zeroes seem to be meaningless) to the features screen seems to fix centerscreen.

Prevent cached iPhone webapp from reloading (scrolling to top)

I have an iPhone webapp that uses a cache manifest to work offline. I add the webapp to my home screen, use it (say scroll to a certain location on a page), then go back to homescreen.
When I open the app again, for a brief moment I see where I used to be (at that scrolled location on that page), but then the app "reloads" and I get scrolled to the top of the mainpage. Is there a way to prevent this "reloading"? This happens even in airplane mode (ie everything is working off the cache).
You're just seeing the default startup image, which is just a screenshot of the last place you were at. It's not "reloading"; the app wasn't loaded to begin with.
Search for "apple-touch-startup-image" to set a real loading image.
What I'm struggling with here is that the app actually seems to stay "in memory" longer if I use regular Safari as opposed to running in "apple-mobile-web-app-capable" mode. In the later case something as simple as pressing the home button, then task-switching back to the app causes a reload. Doing the same thing just in Safari often does not reload. So I'm worse off by using "apple-mobile-web-app-capable".
I don't believe there is a real 'reload' event. onload and onunload are all we get.
the onload handler starts up as if it is your first time coming to the page.
the onunload handler is the key to clearing out old content.
I like to provide alternate content for people who are coming back to my web app.
window.onunload=function(){
document.getElementsByTagName('body')[0].className+=' unloading'
}
And let the CSS do the dirty work to hide most of the body and show alternate content.
(this answer does not rely on jQuery or other frameworks)
// on load
window.scroll(0,0);
To ensure no old content is displayed while launching I use this in my page:
window.addEventListener('unload', function() { $('body').hide(); } );
Thus the last state of the page is empty and is what is shown to the user when the page is opened again.