diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a125be9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,30 @@ +# depandabot to update your package.json or requirements.txt - remove useless sections +# check all configuration options : +# https://docs.github.com/fr/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +# also works with private repository +# https://docs.github.com/fr/code-security/dependabot/working-with-dependabot/configuring-access-to-private-registries-for-dependabot +version: 2 +updates: + # Maintain python pip dependencies in your 'requirement.txt' file + - package-ecosystem: "pip" + directory: "/resources" + target-branch: "beta" + schedule: + interval: weekly + + # Maintain NodeJS dependencies in 'package.json' + - package-ecosystem: npm + directory: "/resources/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + versioning-strategy: increase + target-branch: "beta" + + # Maintain any github-actions workflow + # https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + target-branch: "beta" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..8793e1f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,50 @@ + + + + +## Description + + + +### Suggested changelog entry + + + +### Related issues/external references + +Fixes # + + +## Types of changes + +- [ ] Bug fix _(non-breaking change which fixes)_ +- [ ] New feature _(non-breaking change which adds functionality)_ +- [ ] Breaking change _(fix or feature that would cause existing functionality to change)_ + - [ ] This change is only breaking for integrators, not for external standards or end-users. +- [ ] Documentation improvement + + +## PR checklist + +- [ ] I have checked there is no other PR open for the same change. +- [ ] I have read the [Contribution Guidelines](https://doc.jeedom.com/fr_FR/contribute/). +- [ ] I grant the project the right to include and distribute the code under the GNU. +- [ ] I have added tests to cover my changes. +- [ ] I have verified that the code complies with the projects coding standards. +- [ ] [Required for new sniffs] I have added MD documentation for the sniff. + + diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..08026e2 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,14 @@ +on: + # Create branch > prettier / this workflows create commit on branch prettier. + push: + branches: + - prettier + pull_request: + branches: + - prettier + +name : 'Prettier Plugin Jeedom' + +jobs: + prettier: + uses: jeedom/workflows/.github/workflows/prettier.yml@main diff --git a/.github/workflows/work.yml b/.github/workflows/work.yml new file mode 100644 index 0000000..345021e --- /dev/null +++ b/.github/workflows/work.yml @@ -0,0 +1,15 @@ +on: + # Workflows check plugin Jeedom + push: + branches: + - beta + pull_request: + branches: + - beta + - master + +name : 'Full Workflows Plugin Jeedom' + +jobs: + plugin: + uses: jeedom/workflows/.github/workflows/plugin.yml@main diff --git a/composer.json b/composer.json index c6798f1..45b4ad7 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,5 @@ { - "name": "jeedom/plugin-script", - "description": "Plugin script for Jeedom", "require": { "electrolinux/phpquery": "0.9.*" - }, - "authors": [ - { - "name": "Loic", - "email": "loic@jeedom.com" - } - ] -} + } +} \ No newline at end of file diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 683f8cc..0000000 --- a/composer.lock +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "7c7b651b0d7127245df5e061a71c7b28", - "packages": [ - { - "name": "electrolinux/phpquery", - "version": "0.9.6", - "source": { - "type": "git", - "url": "https://github.com/electrolinux/phpquery.git", - "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/electrolinux/phpquery/zipball/6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a", - "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "phpQuery/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobiasz Cudnik", - "email": "tobiasz.cudnik@gmail.com", - "homepage": "https://github.com/TobiaszCudnik", - "role": "Developer" - }, - { - "name": "didier Belot", - "role": "Packager" - } - ], - "description": "phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library", - "homepage": "http://code.google.com/p/phpquery/", - "time": "2013-03-21 12:39:33" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/core/class/script.class.php b/core/class/script.class.php index 8e8e727..4cb8d26 100644 --- a/core/class/script.class.php +++ b/core/class/script.class.php @@ -18,7 +18,9 @@ /* * ***************************Includes********************************* */ require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php'; -require_once dirname(__FILE__) . '/../../vendor/autoload.php'; +if(file_exists(dirname(__FILE__) . '/../../vendor/autoload.php')){ + require_once dirname(__FILE__) . '/../../vendor/autoload.php'; +} class script extends eqLogic { @@ -120,7 +122,11 @@ public function postSave() { if ($this->getLogicalId() == 'refresh' || $this->getEqlogic()->getIsEnable() != 1) { return; } - $this->refreshInfo(); + try { + $this->refreshInfo(); + } catch (\Throwable $th) { + log::add('script','error',$th->getMessage()); + } } private function replaceTags($request) { diff --git a/desktop/php/script.php b/desktop/php/script.php index a677869..a948638 100644 --- a/desktop/php/script.php +++ b/desktop/php/script.php @@ -48,7 +48,7 @@ foreach ($eqLogics as $eqLogic) { $opacity = ($eqLogic->getIsEnable()) ? '' : 'disableCard'; echo '
'; - echo ''; + echo ''; echo '
'; echo '' . $eqLogic->getHumanName(true, true) . ''; echo '