5 Commits

Author SHA1 Message Date
d2a2a839e4 Fix: PR target event allows external builds (#32) 2022-11-22 22:32:07 +01:00
fe0cb883e7 Add auto reconnect support (#31)
* Update mqtt-client.php

* Update ConnectionManager.php

* Update mqtt-client.php

* Update mqtt-client.php

* Update mqtt-client.php

* Update ConnectionManager.php

* Update mqtt-client.php

* Add and normalize auto-reconnect settings

* Add .gitkeep

* Remove .gitkeep

Co-authored-by: Marvin Mall <marvin-mall@msn.com>
2022-11-22 22:26:38 +01:00
136ce2cb75 Bump actions/checkout from 2 to 3 (#24)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-10 15:50:12 +02:00
c398d5ec07 Add Dependabot and improve build pipeline (#23)
* Add dependabot config

* Update actions/cache and simplify variable usage in build
2022-04-10 15:45:17 +02:00
d237909b6d Feature laravel 9 (#22)
* Support Laravel 9

* Build and test using PHP 8.1
2022-02-10 19:22:40 +01:00
5 changed files with 45 additions and 8 deletions

23
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,23 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
allow:
- dependency-type: "development"
schedule:
interval: "daily"
time: "05:00"
timezone: "Europe/Vienna"
labels:
- "composer dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "05:00"
timezone: "Europe/Vienna"
labels:
- "github actions"

View File

@ -4,7 +4,7 @@ on:
push:
branches:
- master
pull_request:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
@ -15,10 +15,13 @@ jobs:
strategy:
matrix:
php-version: ['7.4', '8.0']
php-version: ['7.4', '8.0', '8.1']
include:
- php-version: '8.1'
run-sonarqube-analysis: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
@ -41,7 +44,7 @@ jobs:
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@ -55,7 +58,7 @@ jobs:
- name: Run SonarQube analysis
uses: sonarsource/sonarcloud-github-action@master
if: matrix.php-version == '8.0'
if: matrix.run-sonarqube-analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

View File

@ -20,8 +20,8 @@
],
"require": {
"php": "^7.4|^8.0",
"illuminate/config": "~7.0|~8.0",
"illuminate/support": "~7.0|~8.0",
"illuminate/config": "~7.0|~8.0|~9.0",
"illuminate/support": "~7.0|~8.0|~9.0",
"php-mqtt/client": "^1.0"
},
"require-dev": {

View File

@ -101,6 +101,14 @@ return [
// The interval (in seconds) in which the client will send a ping to the broker,
// if no other message has been sent.
'keep_alive_interval' => env('MQTT_KEEP_ALIVE_INTERVAL', 10),
// Additional settings for the optional auto-reconnect. The delay between reconnect attempts is in seconds.
'auto_reconnect' => [
'enabled' => env('MQTT_AUTO_RECONNECT_ENABLED', false),
'max_reconnect_attempts' => env('MQTT_AUTO_RECONNECT_MAX_RECONNECT_ATTEMPTS', 3),
'delay_between_reconnect_attempts' => env('MQTT_AUTO_RECONNECT_DELAY_BETWEEN_RECONNECT_ATTEMPTS', 0),
],
],
],

View File

@ -177,6 +177,9 @@ class ConnectionManager
->setLastWillTopic(Arr::get($config, 'last_will.topic'))
->setLastWillMessage(Arr::get($config, 'last_will.message'))
->setLastWillQualityOfService((int) Arr::get($config, 'last_will.quality_of_service', MqttClient::QOS_AT_MOST_ONCE))
->setRetainLastWill((bool) Arr::get($config, 'last_will.retain', false));
->setRetainLastWill((bool) Arr::get($config, 'last_will.retain', false))
->setReconnectAutomatically((bool) Arr::get($config, 'auto_reconnect.enabled', false))
->setMaxReconnectAttempts((int) Arr::get($config, 'auto_reconnect.max_reconnect_attempts', 3))
->setDelayBetweenReconnectAttempts((int) Arr::get($config, 'auto_reconnect.delay_between_reconnect_attempts', 0));
}
}