Download the PHP package mips/jeedom-tools without Composer

On this page you can find all versions of the php package mips/jeedom-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jeedom-tools

jeedom-tools

Tools and helper class for Jeedom plugin development

How to use it

The most simple and cleanest way is to use composer: composer require mips/jeedom-tools

And then to add the autoloader in your eqLogic file, example:

Using composer will make easier to upgrade the library if needed (composer u)

Alternatively you can add the source as you wish to your plugin, add the require statement and make sure to use the trait.

Running eqLogic function asynchronously

To run a function asynchronously we will use the cron system of Jeedom.

First you need to create a method with this signature that will do the work you want:

$_options is a array of value that you will use to pass arguments to your method, exactly like cron tasks.

To execute your method you need to call the executeAsync method:

The static function executeAsync will simply create a new oneTime cron and run it. There is a third argument $_date, which is by default equal to now, to which you can pass any English textual datetime description that strtotime() can interpret.

Creating eqLogic commands

The concept is to define commands to use in a json file, with a defined structure then call the method that will create all corresponding commands. I suggest to put this config file in the following folder of your plugin: /core/config/ and the code snippet below will assume that.

I know it is possible import a json file directly to create commands config put the following give more flexibility and control like ability to assign values only at creation (template & display section), link action & info commands...

The code that actually creates the command has been widely inspired from the one that we can found in some official plugins: I've added some features, made it more generic and put in place a way to share it between all my plugins (this repo) (and maybe yours ;-))

A generic example of json file, below you will see more details information:

As you see you can have different set of commands in your file, nodeand lamp in the example, and they can be created with following line of code:

Below you will find several concrete case. I create commands of my most complexe plugins using this method, it means that I've encountered a lot of use cases already and the current version should cover all your needs so if you don't achieve something or if something is unclear, you probably know how to find me ;-)

A state information and 2 actions on & off

You can see in the example below how to assign generic type, default template, command type & subtype.

Please note that the template section is applied on the command only during creation, if the command already exists the function will not replace it to not override a change done by a user of the plugin.

A slider action command

The example is self-explanatory

A select action command (list)

A color action command

A message action command

The property in the display section are the one available within Jeedom:


All versions of jeedom-tools with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mips/jeedom-tools contains the following files

Loading the files please wait ....