Skip to content

Asking for help: Can’t get news switch to work #4004

Answered by Moonbase59
Moonbase59 asked this question in Q&A
Discussion options

You must be logged in to vote

Phew. After searching and finding the LS docs not helpful at all, I found a hint in a 2013 AirTime forum post, and after only a few hours of frustrating experiments came up with this:

# Reload the news playlist shortly before playing,
# to get latest news and not old queued ones
thread.when(predicate.activates({ 59m45s or 29m45s }), fun() -> playlist_nachrichten.reload())

# Make a News source that is only active at certain times
# Hourly news at 06:00-18:00 and 20:00, 16s past the hour
# to leave room for the TOTH time & station announcement
news = fallback(
  track_sensitive=false,
  [
    switch(
      id="news_switch",
      [(predicate.once({ (6h00-18h00 or 20h00) and 0m16s }), playl…

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@gAlleb
Comment options

Comment options

You must be logged in to vote
2 replies
@gAlleb
Comment options

@Moonbase59
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Moonbase59
Comment options

You must be logged in to vote
1 reply
@gAlleb
Comment options

Comment options

You must be logged in to vote
4 replies
@toots
Comment options

@toots
Comment options

@RouHim
Comment options

@toots
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants