ozmatox / cronxbmc Goto Github PK
View Code? Open in Web Editor NEWThis project forked from robweber/cronxbmc
A simple Cron-like service for Kodi
License: MIT License
This project forked from robweber/cronxbmc
A simple Cron-like service for Kodi
License: MIT License
Cron for Kodi This addon consists of a plugin and a service that will let you schedule various Kodi functions to be run on timers of your choosing. Functions to run can basically be anything from the list of built in Kodi functions (http://kodi.wiki/view/List_of_built-in_functions). Examples include: Rebooting Restart Kodi Take a Screenshot Run another Addon or Script Play Media Refresh RSS Send a Notification Set Volume Update Music/Video Libraries Additionally you can specify your timer to display a notification when they run. Using as a module: If you want to schedule something as part of your own addon you can import the CronManager class as an Kodi addon module. To do this first add the following to your addon.xml file: <import addon="service.cronxbmc" version="Current.Version.Number" /> From within your addon import the required classes using: from cron import CronManager,CronJob You can then get a list of cron jobs, add a new job, or delete existing jobs. Here is the syntax: manager = CronManager() #get jobs jobs = manager.getJobs() #delete a job manager.deleteJob(job.id) #add a job job = CronJob() job.name = "name" job.command = "Shutdown" job.expression = "0 0 * * *" job.show_notification = "false" manager.addJob(job) Please be aware that adding or removing a job will change the job list (and change job ids) so please refresh your job list each time by using: jobs = manager.getJobs() This will also pull in any new jobs that may have been added via other methods Manually Editing the cron.xml file: If you need to you can bypass the GUI and write the cron.xml file yourself, or via a script. The file should have the following layout: <cron> <job name="Job Name" command="Kodi_Command()" expression="* * * * *" show_notification="true/false" /> </cron> Using Cron: A Cron expression is made up for 5 parts (see below). Read up on cron(http://en.wikipedia.org/wiki/Cron) for more information on how to create these expressions. .--------------- minute (0 - 59) | .------------ hour (0 - 23) | | .--------- day of month (1 - 31) | | | .------ month (1 - 12) or Jan, Feb ... Dec | | | | .---- day of week (0 - 6) or Sun(0 or 7), Mon(1) ... Sat(6) V V V V V * * * * * Example: 0 */5 ** 1-5 - runs every five hours Monday - Friday 0,15,30,45 0,15-18 * * * - runs every quarter hour during midnight hour and 3pm-6pm
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.