Skip to content

Commit

Permalink
Merge pull request #26 from jeedom/beta
Browse files Browse the repository at this point in the history
stable
  • Loading branch information
zoic21 authored Aug 31, 2024
2 parents d076874 + 178b759 commit 69fcbd9
Show file tree
Hide file tree
Showing 27 changed files with 145 additions and 162 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/work.yml
Original file line number Diff line number Diff line change
@@ -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
39 changes: 12 additions & 27 deletions core/class/sms.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,17 @@ public static function deamon_info() {
$port = config::byKey('port', 'sms');
if ($port != 'auto') {
$port = jeedom::getUsbMapping($port);
if (@!file_exists($port)) {
$return['launchable'] = 'nok';
$return['launchable_message'] = __('Le port n\'est pas configuré', __FILE__);
if (is_string($port)) {
if (@!file_exists($port)) {
$return['launchable'] = 'nok';
$return['launchable_message'] = __('Le port n\'est pas configuré', __FILE__);
}
exec(system::getCmdSudo() . 'chmod 777 ' . $port . ' > /dev/null 2>&1');
}
exec(system::getCmdSudo() . 'chmod 777 ' . $port . ' > /dev/null 2>&1');
}
return $return;
}

public static function dependancy_info() {
$return = array();
$return['progress_file'] = jeedom::getTmpFolder('sms') . '/dependance';
if (exec(system::getCmdSudo() . system::get('cmd_check') . '-E "python3\-serial|python3\-request|python3\-pyudev" | wc -l') >= 3) {
$return['state'] = 'ok';
} else {
$return['state'] = 'nok';
}
return $return;
}
public static function dependancy_install() {
log::remove(__CLASS__ . '_update');
return array('script' => __DIR__ . '/../../resources/install_#stype#.sh ' . jeedom::getTmpFolder('sms') . '/dependance', 'log' => log::getPathToLog(__CLASS__ . '_update'));
}

public static function deamon_start() {
self::deamon_stop();
$deamon_info = self::deamon_info();
Expand All @@ -74,7 +61,7 @@ public static function deamon_start() {
$port = jeedom::getUsbMapping($port);
}
$sms_path = realpath(__DIR__ . '/../../resources/smsd');
$cmd = '/usr/bin/python3 ' . $sms_path . '/smsd.py';
$cmd = system::getCmdPython3(__CLASS__) . " {$sms_path}/smsd.py";
$cmd .= ' --device ' . $port;
$cmd .= ' --loglevel ' . log::convertLogLevel(log::getLogLevel('sms'));
$cmd .= ' --socketport ' . config::byKey('socketport', 'sms');
Expand Down Expand Up @@ -256,13 +243,11 @@ public function execute($_options = null) {
$values = $tmp_values;
}
}
if (config::byKey('port', 'sms', 'none') != 'none') {
foreach ($values as $value) {
$socket = socket_create(AF_INET, SOCK_STREAM, 0);
socket_connect($socket, '127.0.0.1', config::byKey('socketport', 'sms'));
socket_write($socket, $value, strlen($value));
socket_close($socket);
}
foreach ($values as $value) {
$socket = socket_create(AF_INET, SOCK_STREAM, 0);
socket_connect($socket, '127.0.0.1', config::byKey('socketport', 'sms'));
socket_write($socket, $value, strlen($value));
socket_close($socket);
}
}
}
1 change: 1 addition & 0 deletions core/config/sms.config.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[sms]
port = 'auto'
maxChartByMessage = 140
serial_rate = 115200
socketport = 55002
Expand Down
1 change: 0 additions & 1 deletion core/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Nicht autorisierter Zugriff",
"Port SMS": "SMS-Port",
"Aucun": "Ohne",
"Auto": "Auto",
"Vitesse de communication (bauds)": "Kommunikationsgeschwindigkeit (Baud)",
"Code pin (laisser vide s'il n'y en a pas)": "PIN-Code (leer lassen, wenn keiner vorhanden ist)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Unauthorized access",
"Port SMS": "SMS port",
"Aucun": "None",
"Auto": "Auto",
"Vitesse de communication (bauds)": "Communication speed (baud)",
"Code pin (laisser vide s'il n'y en a pas)": "Pin code (leave blank if there is none)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Acceso no autorizado",
"Port SMS": "Puerto de SMS",
"Aucun": "Ninguna",
"Auto": "Auto",
"Vitesse de communication (bauds)": "Velocidad de comunicación (baudios)",
"Code pin (laisser vide s'il n'y en a pas)": "Código PIN (dejar en blanco si no hay ninguno)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Accès non autorisé",
"Port SMS": "Port SMS",
"Aucun": "Aucun",
"Auto": "Auto",
"Vitesse de communication (bauds)": "Vitesse de communication (bauds)",
"Code pin (laisser vide s'il n'y en a pas)": "Code pin (laisser vide s'il n'y en a pas)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/id_ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Akses tidak sah",
"Port SMS": "Port SMS",
"Aucun": "Tak ada",
"Auto": "Auto",
"Vitesse de communication (bauds)": "Vitesse de communication (bauds)",
"Code pin (laisser vide s'il n'y en a pas)": "Code pin (laisser vide s'il n'y en a pas)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Accesso non autorizzato",
"Port SMS": "Port SMS",
"Aucun": "Nessuno",
"Auto": "Auto",
"Vitesse de communication (bauds)": "Vitesse de communication (bauds)",
"Code pin (laisser vide s'il n'y en a pas)": "Code pin (laisser vide s'il n'y en a pas)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401-不正アクセス",
"Port SMS": "Port SMS",
"Aucun": "何でもありません",
"Auto": "",
"Vitesse de communication (bauds)": "Vitesse de communication (bauds)",
"Code pin (laisser vide s'il n'y en a pas)": "Code pin (laisser vide s'il n'y en a pas)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/pt_PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Acesso não autorizado",
"Port SMS": "Porta SMS",
"Aucun": "Nemhum",
"Auto": "Carro",
"Vitesse de communication (bauds)": "Velocidade de comunicação (baud)",
"Code pin (laisser vide s'il n'y en a pas)": "Código PIN (deixe em branco se não houver nenhum)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Несанкционированный доступ",
"Port SMS": "Port SMS",
"Aucun": "Нет",
"Auto": "Автомобиль",
"Vitesse de communication (bauds)": "Vitesse de communication (bauds)",
"Code pin (laisser vide s'il n'y en a pas)": "Code pin (laisser vide s'il n'y en a pas)",
Expand Down
1 change: 0 additions & 1 deletion core/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"plugins\/sms\/plugin_info\/configuration.php": {
"401 - Accès non autorisé": "401 - Yetkisiz erişim",
"Port SMS": "Port SMS",
"Aucun": "Hiçbir",
"Auto": "Otomatik",
"Vitesse de communication (bauds)": "Vitesse de communication (bauds)",
"Code pin (laisser vide s'il n'y en a pas)": "Code pin (laisser vide s'il n'y en a pas)",
Expand Down
13 changes: 6 additions & 7 deletions docs/de_DE/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
>
>Zur Erinnerung: Wenn keine Informationen zum Update vorhanden sind, bedeutet dies, dass es sich nur um die Aktualisierung von Dokumentation, Übersetzung oder Text handelt
# 25.06.2023
## 31.08.2024

- Neuer Befehl hinzugefügt **Nachricht senden an** So können Sie eine SMS an eine personalisierte Nummer senden, ohne eine Bestellung für den Kontakt erstellen zu müssen. Auf diese Weise können Sie beispielsweise eine SMS an eine Nummer senden, die Sie über einen Info-Befehl von einem anderen Gerät unter Jeedom erhalten haben. Achtung, es erfolgt keine Überprüfung der Nummer, Sie müssen die Nummern im internationalen Format angeben.
- Deaktivieren Sie die Flusskontrolle beim Herstellen einer Verbindung zum Modem, um Probleme mit bestimmten Modems (z. B. Lixee-Modem) zu vermeiden)
- Debian 12-Kompatibilität
- Mindestversion von Jeedom erforderlich: 4.4.8

# 06.11.2022
# 01.10.2024

- Neuer Befehl hinzugefügt **Nachricht senden an** So können Sie eine SMS an eine personalisierte Nummer senden, ohne eine Bestellung für den Kontakt erstellen zu müssen. Auf diese Weise können Sie beispielsweise eine SMS an eine Nummer senden, die Sie über einen Info-Befehl von einem anderen Gerät unter Jeedom erhalten haben. Achtung, es erfolgt keine Überprüfung der Nummer, Sie müssen die Nummern im internationalen Format angeben.
- Deaktivieren Sie die Flusskontrolle beim Herstellen einer Verbindung zum Modem, um Probleme mit bestimmten Modems (z. B. Lixee-Modem) zu vermeiden)
- Zwei neue Optionen hinzugefügt: **Nachrichten von unbekannten Nummern zulassen** & **Unbekannte Nummern automatisch hinzufügen**; siehe Dokumente.

# 21.10.2022

- Behebung eines Problems mit einigen GSM-Schlüsseln, die beim Starten des Daemons falsche Zeichen zurückgeben.

# 18.10.2022
Expand Down
13 changes: 6 additions & 7 deletions docs/en_US/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
>
>As a reminder if there is no information on the update, it means that it only concerns the updating of documentation, translation or text
# 06/25/2023
## 08/31/2024

- Added a new command **Send message to** allowing you to send an SMS to a personalized number without having to create the contact's order. This allows you to send an sms to a number obtained via an info command from another device under Jeedom for example. Attention, no verification of the number is carried out, you must provide the numbers in international format.
- Disabling flow control when connecting to the modem to avoid problems with certain modems (for example lixee modem)
- Debian 12 Compatibility
- Minimum jeedom version required: 4.4.8

# 11/06/2022
# 10/01/2024

- Added a new command **Send message to** allowing you to send an SMS to a personalized number without having to create the contact's order. This allows you to send an sms to a number obtained via an info command from another device under Jeedom for example. Attention, no verification of the number is carried out, you must provide the numbers in international format.
- Disabling flow control when connecting to the modem to avoid problems with certain modems (for example lixee modem)
- Added two new options: **Allow messages from unknown numbers** & **Automatically add unknown numbers**; see docs.

# 21/10/2022

- Fix an issue with some gsm keys returning incorrect characters when starting the daemon.

# 10/18/2022
Expand Down
13 changes: 6 additions & 7 deletions docs/es_ES/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
>
>Como recordatorio si no hay información sobre la actualización, significa que solo se refiere a la actualización de documentación, traducción o texto
# 25/06/2023
## 31/08/2024

- Se agregó un nuevo comando **Enviar mensaje a** permitiéndole enviar un SMS a un número personalizado sin tener que crear el pedido del contacto. Esto le permite enviar un sms a un número obtenido a través de un comando de información desde otro dispositivo bajo Jeedom, por ejemplo. Atención, no se realiza ninguna verificación del número, debe proporcionar los números en formato internacional.
- Deshabilitar el control de flujo al conectarse al módem para evitar problemas con ciertos módems (por ejemplo, módem lixee)
- Compatibilidad con Debian 12
- Se requiere una versión mínima de jeedom: 4.4.8

# 06/11/2022
# 01/10/2024

- Se agregó un nuevo comando **Enviar mensaje a** permitiéndole enviar un SMS a un número personalizado sin tener que crear el pedido del contacto. Esto le permite enviar un sms a un número obtenido a través de un comando de información desde otro dispositivo bajo Jeedom, por ejemplo. Atención, no se realiza ninguna verificación del número, debe proporcionar los números en formato internacional.
- Deshabilitar el control de flujo al conectarse al módem para evitar problemas con ciertos módems (por ejemplo, módem lixee)
- Se agregaron dos nuevas opciones: **Permitir mensajes de números desconocidos** & **Agregar automáticamente números desconocidos**; ver documentos.

# 21/10/2022

- Solucione un problema con algunas teclas gsm que devuelven caracteres incorrectos al iniciar el daemon.

# 18/10/2022
Expand Down
5 changes: 5 additions & 0 deletions docs/fr_FR/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
>
>Pour rappel s'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte
## 31/08/2024

- Compatibilité Debian 12
- Version minimum jeedom requise: 4.4.8

# 10/01/2024

- Ajout d'une nouvelle commande **Envoyer message à** permettant d'envoyer un sms à un numéro personnalisé sans devoir créer la commande du contact. Cela permet d'envoyer un sms à un numéro obtenu via une commande info d'un autre équipement sous Jeedom par exemple. Attention, aucune vérification du numéro n'est effectuée, il faut fournir les numéros au format international.
Expand Down
8 changes: 5 additions & 3 deletions docs/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
"changelog.md": {
"Changelog SMS": "Changelog SMS",
"Pour rappel s'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte": "Zur Erinnerung: Wenn keine Informationen zum Update vorhanden sind, bedeutet dies, dass es sich nur um die Aktualisierung von Dokumentation, Übersetzung oder Text handelt",
"25\/06\/2023": "25.06.2023",
"31\/08\/2024": "31.08.2024",
"Compatibilité Debian 12": "Debian 12-Kompatibilität",
"Version minimum jeedom requise": "Mindestversion von Jeedom erforderlich",
"4.4.8": "4.4.8",
"10\/01\/2024": "01.10.2024",
"Envoyer message à": "Nachricht senden an",
"Ajout d'une nouvelle commande": "Neuer Befehl hinzugefügt",
"permettant d'envoyer un sms à un numéro personnalisé sans devoir créer la commande du contact": "So können Sie eine SMS an eine personalisierte Nummer senden, ohne eine Bestellung für den Kontakt erstellen zu müssen",
"Cela permet d'envoyer un sms à un numéro obtenu via une commande info d'un autre équipement sous Jeedom par exemple": "Auf diese Weise können Sie beispielsweise eine SMS an eine Nummer senden, die Sie über einen Info-Befehl von einem anderen Gerät unter Jeedom erhalten haben",
"Attention, aucune vérification du numéro n'est effectuée, il faut fournir les numéros au format international": "Achtung, es erfolgt keine Überprüfung der Nummer, Sie müssen die Nummern im internationalen Format angeben",
"Désactivation du flow control lors de la connexion au modem pour éviter des problèmes avec certains modem (par exemple modem lixee": "Deaktivieren Sie die Flusskontrolle beim Herstellen einer Verbindung zum Modem, um Probleme mit bestimmten Modems (z. B. Lixee-Modem) zu vermeiden",
"06\/11\/2022": "06.11.2022",
"Autoriser les messages de numéros inconnus": "Nachrichten von unbekannten Nummern zulassen",
"Ajouter automatiquement les numéros inconnus": "Unbekannte Nummern automatisch hinzufügen",
"Ajout de deux nouvelles options": "Zwei neue Optionen hinzugefügt",
"&": "&",
"; voir documentation": "; siehe Dokumente",
"21\/10\/2022": "21.10.2022",
"Fix un problème avec certaines clés gsm renvoyant des caractères incorrectes lors du démarrage du démon": "Behebung eines Problems mit einigen GSM-Schlüsseln, die beim Starten des Daemons falsche Zeichen zurückgeben",
"18\/10\/2022": "18.10.2022",
"Mise à jour liste des commandes pour Jeedom v4.3": "Befehlsliste für Jeedom v4.3 aktualisieren",
Expand Down
8 changes: 5 additions & 3 deletions docs/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
"changelog.md": {
"Changelog SMS": "Changelog SMS",
"Pour rappel s'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte": "As a reminder if there is no information on the update, it means that it only concerns the updating of documentation, translation or text",
"25\/06\/2023": "06\/25\/2023",
"31\/08\/2024": "08\/31\/2024",
"Compatibilité Debian 12": "Debian 12 Compatibility",
"Version minimum jeedom requise": "Minimum jeedom version required",
"4.4.8": "4.4.8",
"10\/01\/2024": "10\/01\/2024",
"Envoyer message à": "Send message to",
"Ajout d'une nouvelle commande": "Added a new command",
"permettant d'envoyer un sms à un numéro personnalisé sans devoir créer la commande du contact": "allowing you to send an SMS to a personalized number without having to create the contact's order",
"Cela permet d'envoyer un sms à un numéro obtenu via une commande info d'un autre équipement sous Jeedom par exemple": "This allows you to send an sms to a number obtained via an info command from another device under Jeedom for example",
"Attention, aucune vérification du numéro n'est effectuée, il faut fournir les numéros au format international": "Attention, no verification of the number is carried out, you must provide the numbers in international format",
"Désactivation du flow control lors de la connexion au modem pour éviter des problèmes avec certains modem (par exemple modem lixee": "Disabling flow control when connecting to the modem to avoid problems with certain modems (for example lixee modem",
"06\/11\/2022": "11\/06\/2022",
"Autoriser les messages de numéros inconnus": "Allow messages from unknown numbers",
"Ajouter automatiquement les numéros inconnus": "Automatically add unknown numbers",
"Ajout de deux nouvelles options": "Added two new options",
"&": "&",
"; voir documentation": "; see docs",
"21\/10\/2022": "21\/10\/2022",
"Fix un problème avec certaines clés gsm renvoyant des caractères incorrectes lors du démarrage du démon": "Fix an issue with some gsm keys returning incorrect characters when starting the daemon",
"18\/10\/2022": "10\/18\/2022",
"Mise à jour liste des commandes pour Jeedom v4.3": "Update command list for Jeedom v4.3",
Expand Down
Loading

0 comments on commit 69fcbd9

Please sign in to comment.