How to Remove StartStop trait from the device model - traits

complete noob here. I got the assistant sdk running on a rasp pi 3+ (woot!). Everything is running swell, I can trigger some routines configured in my google home app/profile. One of them being to play the "news" / podcasts. While it is playing back though, i cannot get the assistant to stop playback. I try saying "Ok Google, stop" or stop playback and it acknowledges but the podcast keeps playing.
On this site (which I used for the whole setup)
https://developers.google.com/assistant/sdk/guides/library/troubleshooting#podcast_and_news_playback_issues
It says:
Podcast and news playback issues
The Assistant does not follow playback commands (for example, pausing or stopping a podcast).
This is an issue if you have the StartStop or OnOff trait enabled for a given device model. Remove this trait from the device model and playback commands will work.
I hoping this is what I need to do but I don't know how to actually do this. How do I remove the StartStop or OnOff trait?
Any help would be great! Thanks

You can register actions for your device. When setting up your device model, you can configure the types of actions that you want to run. From there, you can disable certain traits like StartStop.

Related

Set AudioAttributes Volume

After searching for a very long time for a way to play notification noises only through the headphones (when plugged in), on a stream separate from STREAM_MUSIC, in a way that could interrupt and be completely audible over any background music, Android finally came out with the AudioAttributes API. By using the following code, I'm able to achieve exactly what I want for notifications, at least in API 21 or higher (STREAM_MUSIC is the best option I've found for lower versions):
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build();
Unfortunately, there doesn't appear to be any way to adjust the volume of the sonification in my app's settings. I currently use the AudioManager in the following way, but it only allows volume adjustments to streams, and none of STREAM_ALARM, STREAM_NOTIFICATION, STREAM_RING, or STREAM_MUSIC applies to whatever routing strategy is used for the sonification:
audioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION, originalVolume, 0);
Does anyone have any suggestion on how to set the volume corresponding to the AudioAttributes output? Keep in mind that the audio is actually played in a BroadcastReceiver that's used for the actual notification, and the audio setting would be specified in just some settings Activity.
Well, it appears that I missed a critical table in the API documentation:
https://source.android.com/devices/audio/attributes.html
It seems that STREAM_SYSTEM is the equivalent of what I was attempting to do with AudioAttributes. Basically, using the code I have above is sufficient for API 21 and forward, and use of STREAM_SYSTEM does everything necessary for the AudioManager and APIs prior to 21.

Motion and fswebcam running

I am using fswebcam to capture and image, when an email is received. I thought that it would be nice to have Motion running as well. I installed Motion, and that worked fine.
However, when I tried to use fswebcam to take a picture,
I received the error:
Error selecting input 0
VIDIOC_S_INPUT: Device or resource busy
then I stopped Motion, and tried it again. It worked. So, I can only have one program accessing the camera at a time.
Is there any way round this?
Use one or the other, two apps can't read the same video camera device at the same time.
Motion is capable of running a script on event detection, so if you want to do that look in the config for on_area_detected or on_movie_start
Then get it to call some kind of shell script that attaches the current photo and emails it to you.
Hope you don't get too many events, else there will be too many emails to find the important ones.
You can use the Motion HTTP Based Control. Simply call:
http://yourraspberrypi:XXXX/0/action/snapshot
using cURL or any other method that you prefer.
Where yourraspberrypi should be the IP of your Pi, and XXXX should be the port defined under 'control_port', in /etc/motion/motion.conf
Note: A symbolic link called lastsnap.jpg created in the target_dir will always point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
You can also use the HTTP Based Control, for example, to stop/start motion detection
More info here: http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionHttpAPI
It worked for me after uninstalling motion. To do so, run the following command from the terminal:
sudo apt-get remove motion

Manual testing for GPS on ios

I'm a newbie in testing area. I have an application which has the facility to use gps and I don't have garmin tracker. I have done few tests on gps but i don't feel it's sufficient.
How to test gps manually?
What are the ways and methods to test it? please, suggest some testcases for it.
1.Need to test while traveling how the application is working with Gps connection.
2.How the Application is behaving while we got a call/Message.
3.How the Application is behaving while battery low /Automatic turn off u r phone,the current data is saved in data base properly or not
4.Need to check Battery life while using GPS
I am sure your done with smoke testing!, In that case start with Interruption testing.
Keep moving in a place, check the your GPS connectivity.
Travel to remote places where you feel the GPS can't be tracked. Check how your application responds.
Try receiving call while using the Application.
Place an alarm, check how your application responds during alarm work.
Check when your device is about to die, how the application responds. Since you'l be using GPS, chances of u'r battery drain is too high.
Check with Notification. how your application behaves.
Switch off your GPS, see if an appropriate alert is provided.

How to register for Win8 periodic tile notifications?

I am working on a Win8-UI-App (previously called Metro...) and trying to implement Periodic (Documentation for different methods) Tile Updates (Live Tiles) for the first time.
I found a couple of very good resources on the internet and was able to do it. Unfortunately the question of where I should register for the notifications remained unsolved:
Do I have to register for Notifications every time the app starts (e.g. in the App.xaml.cs OnLaunched() Method)? - Or is there an other, more professional way to do so? (I could imagine to save if I already registered for the service or is there a variable I can access to see whether notifications are registered?)
thank you!
PS: For everyone who is also new to this see this StackOverflow post, this example, the tile template types and the Dev Center for quick starting :)
Periodic updates will continue until they are explicitly stopped or your app is uninstalled. Technically, you only have to do that once. But, the Guidelines and checklist for periodic updates states
Call the StartPeriodicUpdate or StartPeriodicUpdateBatch method each
time your app is launched or brought into focus. This ensures that the
tile content will be updated each time the user launches or switches
to the app.
According to that, App launch and App resume are good candidates for a call to StartPeriodicUpdate.

UIApplication Idle Timer

This is a simple question and I can not seem to find any information on it, but I just want to know if the following code will get my app rejected or not. Basically, is this a private API
[application setIdleTimerDisabled:YES];
I want to add this to my AppDelegate under didFinishLaunchingWithOptions. I just do not want to use something so simple and get my app rejected. Thanks for any information!
It's public, though apple advises:
Important You should set this property only if necessary and should be
sure to reset it to NO when the need no longer exists. Most
applications should let the system turn off the screen when the idle
timer elapses. This includes audio applications. With appropriate use
of Audio Session Services, playback and recording proceed
uninterrupted when the screen turns off. The only applications that
should disable the idle timer are mapping applications, games, or
similar programs with sporadic user interaction.
So you should be okay if your app is as they describe, or if you use it sparingly.