Does the Nest API allow read access of the thermostat current state(S) (is heating/is cooling/is fan on)?
I can't see it in the API Reference, or the actual JSON, but it seems strange that the Nest Developer Chrome Extension allows the state to be changed if it cannot be accessed by the API.
Related
Technology Information: ReactJS + Typescript for the frontend. REST API built with nodeJS+express that stores data in a Cloud Firestore database. The frontend React application retrieves data using the REST API.
State Management on the Frontend: I'm currently using React hooks for state management. useContext is used for managing global state (user/session information), and useReducer is used for route level state. The useReducer hook is called by the top level component in any given route.
Advice Requested:
If the user takes an action with the UI, I want to update the local state and show the appropriate changes in the UI instantly. I want to make sure the data gets saved to our backend, and only display an error message if we failed to save the data.
What's the most seamless way of handling data synchronization in this case? What's the best architecture here?
Should I make calls to the REST API from within each action in the
reducer?
What's the cleanest way to implement this throughout a large application? How should I organize my code for data synchronization?
Along the same lines, if I want to listen to changes to the user
object in the backend, and reload the user's information that's
stored in global state using the useContext hook, how should I try
to do this?
P.S. I love how seamlessly Asana syncs & saves your data. I'm wondering what are the best practices here if I want to have that seamless of an experience.
I'm trying to use the Assistant2 APIs inside my Web Application (Angular CLI project) with the ibm-watson library and the suggested Webpack Configuration.
But at runtime I get different CORS policy errors calling the Assistant2 APIs.
So it's possible to use the Assistant2 APIs via browser?? Or calls must be all made server side to avoid the CORS policy errors?
Well, Watson Assistant provides REST API that can be called from anywhere where there is access to IBM Cloud (which bacicaly means access to internet) - so from browser as well.
Now, while you can call the Watson Assistant REST API directly from the client-side browser, sometimes it might be beneficial to have a server doing the actual call as when you call the REST API from the browser then the user has access to the request and the response from the system. This means the user has access to context part of the dialog response which in some cases might not be desired (depends on the stuff that the author is storing in the context).
is is possible to tell what source changed the temperature through the api, human/scheduled/another client?
I noticed the nest app history lists how the temperature was set and didn't notice anything in the api that says that.
That level of info is not in the API, but like you said the nest app will, show which client actually initiated the change.
In the Nest Developer Tool (Chrome), I have Structure ID a while in the actual returned JSON blob I get a different Structure ID b.
I think you are using the Chrome Extension which has been deprecated (as per the banner at the top of this page)
There is a new Chrome App, called the Nest Home Simulator, that should solve your problem.
I'm using the "request" module and passing all the correct arguments for the eBay API's FindPopularSearches endpoint and no matter what I do, I keep getting this error:
Getting popular keywords is not enabled on current site.
At first I thought it was a mismatch between the categoryID I had fetched and the siteid I was using. But double-checking that with someone else's code, I was able to conclude that my API call was properly built.
http://open.api.sandbox.ebay.com/shopping?appid=<my-app-id>&callname=FindPopularSearches&siteid=0&responseencoding=JSON&version=847&CategoryID=10159
Shopping API calls such as FPS don't work too well with Sandbox, as you discovered. Since such calls are read-only, eBay recommends simply making them directly to Production.
I tried switching to a production app id, and using the production API and this solved my problem. AFAIK, this call does not seem to function in sandbox mode.
It would have been nice to have written that down in an obvious place in the docs but hey, that's why I'm leaving it here.
So I guess the "site" in the error message means sandbox vs production.