4
submitted 1 year ago by rambos@lemmy.world to c/android@lemmy.world

Hey guys, I'm using Home Assistant to set alarms on my phone and its working fine. I can set alarm time with a message using this string in my yaml file:

"android.intent.extra.alarm.HOUR:{{8}},android.intent.extra.alarm.MINUTES:{{15}},android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:Take Medication"

Now I'd like to add a daily repeat or for example repeat every Wednesday. From the same source I found it should be possible using EXTRA_DAYS. I couldn't find any example so I was trying every combination that came to my mind like:

android.intent.extra.alarm.DAYS:{{Calendar.SATURDAY, Calendar.WEDNESDAY}}
android.intent.extra.alarm.DAYS:{{ [Calendar.SATURDAY, Calendar.WEDNESDAY] }}
android.intent.extra.alarm.DAYS:[Calendar.SATURDAY, Calendar.WEDNESDAY]
etc.

How to shape that android.intent.extra.alarm.DAYS properly? Documentation says the values should be ArrayList<Integer>:

Documentation is on this link

you are viewing a single comment's thread
view the rest of the comments
[-] bowroat@infosec.pub 1 points 1 year ago

This is a bit over my head, but have you seen this answer? https://stackoverflow.com/a/43409682

From that link: "construct an ArrayList from Calendar.SATURDAY and pass it to putExtra()"

this post was submitted on 05 Jul 2023
4 points (83.3% liked)

Android

27551 readers
385 users here now

DROID DOES

Welcome to the droidymcdroidface-iest, Lemmyest (Lemmiest), test, bestest, phoniest, pluckiest, snarkiest, and spiciest Android community on Lemmy (Do not respond)! Here you can participate in amazing discussions and events relating to all things Android.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules


1. All posts must be relevant to Android devices/operating system.


2. Posts cannot be illegal or NSFW material.


3. No spam, self promotion, or upvote farming. Sources engaging in these behavior will be added to the Blacklist.


4. Non-whitelisted bots will be banned.


5. Engage respectfully: Harassment, flamebaiting, bad faith engagement, or agenda posting will result in your posts being removed. Excessive violations will result in temporary or permanent ban, depending on severity.


6. Memes are not allowed to be posts, but are allowed in the comments.


7. Posts from clickbait sources are heavily discouraged. Please de-clickbait titles if it needs to be submitted.


8. Submission statements of any length composed of your own thoughts inside the post text field are mandatory for any microblog posts, and are optional but recommended for article/image/video posts.


Community Resources:


We are Android girls*,

In our Lemmy.world.

The back is plastic,

It's fantastic.

*Well, not just girls: people of all gender identities are welcomed here.


Our Partner Communities:

!android@lemmy.ml


founded 1 year ago
MODERATORS