Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: translate

on:
workflow_dispatch:
push:
branches:
- beta

jobs:
auto-translate:
runs-on: ubuntu-latest
steps:
- uses: jeedom/jeetranslate@main
with:
deepl_api_key: ${{ secrets.DEEPL_API_KEY }}
include_empty_translation: false
target_languages: "en_US,es_ES,de_DE,it_IT,pt_PT"
use_core_translations: true
4 changes: 3 additions & 1 deletion core/class/ash.class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
include_file('core', 'ash_PowerLevelController', 'class', 'ash');
include_file('core', 'ash_ToggleController', 'class', 'ash');
include_file('core', 'ash_LockController', 'class', 'ash');
include_file('core', 'ash_GarageDoorController', 'class', 'ash');

class ash extends eqLogic {

Expand Down Expand Up @@ -68,7 +69,7 @@ public static function getSupportedType() {
'DOOR' => array('name' => __('Porte', __FILE__), 'skills' => array('ContactSensor', 'LockController')),
'EXTERIOR_BLIND' => array('name' => __('Volet', __FILE__), 'skills' => array('RangeController')),
'FAN' => array('name' => __('Ventilateur', __FILE__), 'skills' => array('PowerController', 'RangeController')),
'GARAGE_DOOR' => array('name' => __('Porte de garage', __FILE__), 'skills' => array('ContactSensor')),
'GARAGE_DOOR' => array('name' => __('Porte de garage', __FILE__), 'skills' => array('ContactSensor', 'GarageDoorController')),
'MICROWAVE' => array('name' => __('Micro-onde', __FILE__), 'skills' => array('PowerController')),
'NETWORK_HARDWARE' => array('name' => __('Equipement réseaux', __FILE__), 'skills' => array('PowerController')),
'PRINTER' => array('name' => __('Imprimante', __FILE__), 'skills' => array('PowerController')),
Expand Down Expand Up @@ -204,6 +205,7 @@ public static function exec($_data) {
if (isset($return['event']['endpoint']['cookie'])) {
unset($return['event']['endpoint']['cookie']);
}
$return['event']['header']['messageId'] = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4));
return $return;
}

Expand Down
129 changes: 129 additions & 0 deletions core/class/ash_GarageDoorController.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php
require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';

class ash_GarageDoorController {

private static $_OPEN = array('GB_OPEN', 'GARAGE_OPEN');
private static $_CLOSE = array('GB_CLOSE', 'GARAGE_CLOSE');
private static $_STATE = array('GARAGE_STATE', 'BARRIER_STATE');

public static function discover($_device, $_eqLogic) {
$return = array();
$return['capabilities'] = array();

$return['capabilities']['Alexa.GarageDoorController'] = array (
'type' => 'AlexaInterface',
'interface' => 'Alexa.ModeController',
'instance' => 'GarageDoor.Position',
'version' => '3',
'properties' => array (
'supported' => array(array('name' => 'mode')),
'proactivelyReported' => false,
'retrievable' => false,
),
'capabilityResources' => array (
'friendlyNames' => array(
array('@type' => 'asset', 'value' => array ('assetId' => 'Alexa.Setting.Opening'))
),
),
'configuration' => array (
'ordered' => false,
'supportedModes' => array (
array(
'value' => 'Position.Up',
'modeResources' => array('friendlyNames' => array(array('@type' => 'asset', 'value' => array('assetId' => 'Alexa.Value.Open'))))
),
array(
'value' => 'Position.Down',
'modeResources' => array('friendlyNames' => array(array('@type' => 'asset', 'value' => array('assetId' => 'Alexa.Value.Close'))))
)
)
),
'semantics' => array (
'actionMappings' => array (
array (
'@type' => 'ActionsToDirective',
'actions' => array ('Alexa.Actions.Open', 'Alexa.Actions.Raise'),
'directive' => array ('name' => 'SetMode', 'payload' => array ('mode' => 'Position.Up'))
),
array (
'@type' => 'ActionsToDirective',
'actions' => array ('Alexa.Actions.Close', 'Alexa.Actions.Lower'),
'directive' => array ('name' => 'SetMode', 'payload' => array ('mode' => 'Position.Down'))
),
),
'stateMappings' => array (
array ('@type' => 'StatesToValue', 'states' => array ('Alexa.States.Open'), 'value' => 'Position.Up'),
array ('@type' => 'StatesToValue', 'states' => array ('Alexa.States.Closed'), 'value' => 'Position.Down'),
),
),
);

foreach ($_eqLogic->getCmd() as $cmd) {
if (in_array($cmd->getGeneric_type(), self::$_OPEN)) {
$return['cookie']['GarageDoorController_setOpen'] = $cmd->getId();
}
if (in_array($cmd->getGeneric_type(), self::$_CLOSE)) {
$return['cookie']['GarageDoorController_setClose'] = $cmd->getId();
}
if (in_array($cmd->getGeneric_type(), self::$_STATE)) {
$return['capabilities']['Alexa.GarageDoorController']['properties']['retrievable'] = true;
$return['cookie']['GarageDoorController_getState'] = $cmd->getId();
}
}

if (!isset($return['cookie']['GarageDoorController_setOpen']) || !isset($return['cookie']['GarageDoorController_setClose'])) {
return array();
}

return $return;
}

public static function needGenericType(){
return array(
__('Ouvrir',__FILE__) => self::$_OPEN,
__('Fermer',__FILE__) => self::$_CLOSE,
__('Etat',__FILE__) => self::$_STATE
);
}

public static function exec($_device, $_directive) {
if ($_directive['header']['name'] == 'SetMode') {
$mode = $_directive['payload']['mode'];
if ($mode == 'Position.Up' && isset($_directive['endpoint']['cookie']['GarageDoorController_setOpen'])) {
$cmd = cmd::byId($_directive['endpoint']['cookie']['GarageDoorController_setOpen']);
if (is_object($cmd)) $cmd->execCmd();
} else if ($mode == 'Position.Down' && isset($_directive['endpoint']['cookie']['GarageDoorController_setClose'])) {
$cmd = cmd::byId($_directive['endpoint']['cookie']['GarageDoorController_setClose']);
if (is_object($cmd)) $cmd->execCmd();
}
}
return self::getState($_device, $_directive);
}

public static function getState($_device, $_directive) {
$return = array();
$cmd = null;
if (isset($_directive['endpoint']['cookie']['GarageDoorController_getState'])) {
$cmd = cmd::byId($_directive['endpoint']['cookie']['GarageDoorController_getState']);
}
if (!is_object($cmd)) return $return;

$value = $cmd->execCmd();
if ($cmd->getSubtype() == 'binary' && $cmd->getDisplay('invertBinary') == 1) {
$value = ($value) ? 0 : 1;
}

$modeValue = ($value) ? 'Position.Up' : 'Position.Down';

$return[] = array(
'namespace' => 'Alexa.ModeController',
'instance' => 'GarageDoor.Position',
'name' => 'mode',
'value' => $modeValue,
'timeOfSample' => date('Y-m-d\TH:i:s\Z', strtotime($cmd->getValueDate())),
'uncertaintyInMilliseconds' => 0,
);
return array('properties' => $return);
}
}
1 change: 1 addition & 0 deletions core/class/ash_PowerController.class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public static function exec($_device, $_directive) {
}
break;
}
usleep(500000);
return self::getState($_device, $_directive);
}

Expand Down
4 changes: 2 additions & 2 deletions core/class/ash_RangeController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ public static function exec($_device, $_directive) {
$cmd->execCmd(array('slider' => $cmdState->execCmd() + $value));
}
case 'SetRangeValue':
if($_device->getOptions('OpenClose::invertSet',0) == 1){
$execution['payload']['rangeValue'] = 100 - $execution['payload']['rangeValue'];
if($_device->getOptions('RangeController::invertSet',0) == 1){
$_directive['payload']['rangeValue'] = 100 - $_directive['payload']['rangeValue'];
}
if (isset($_directive['endpoint']['cookie']['RangeController_setSlider'])) {
$cmd = cmd::byId($_directive['endpoint']['cookie']['RangeController_setSlider']);
Expand Down
4 changes: 4 additions & 0 deletions docs/de_DE/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
>
>Zur Erinnerung: Wenn keine Informationen zum Update vorhanden sind, bedeutet dies, dass es sich nur um die Aktualisierung von Dokumentation, Übersetzung oder Text handelt

-

# 11.06.2024

- Ein Problem mit PHP8 wurde behoben

# 23.09.2024
Expand Down
4 changes: 4 additions & 0 deletions docs/en_US/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
>
>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/11/2024

- Fixed an issue with PHP8

# 09/23/2024
Expand Down
4 changes: 4 additions & 0 deletions docs/es_ES/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
>
>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

-

# 11/06/2024

- Se solucionó un problema con PHP8

# 23/09/2024
Expand Down
7 changes: 7 additions & 0 deletions docs/fr_FR/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
>
>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

# 24/07/2026

- Correction d'un bug sur l'inversion des volets
- Correction de bugs
- Ajout porte de garage (merci @ripleyXLR8)


# 06/11/2024

- Correction d'un soucis avec PHP8
Expand Down
2 changes: 2 additions & 0 deletions docs/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"changelog.md": {
"Changelog Alexa": "Changelog Alexa",
"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",
"Correction d'un bug sur l'inversion des volets": "",
"06\/11\/2024": "11.06.2024",
"Correction d'un soucis avec PHP8": "Ein Problem mit PHP8 wurde behoben",
"23\/09\/2024": "23.09.2024",
"Correction d'un bug sur jeedom 4.4": "Ein Fehler in Jeedom 4.4 wurde behoben",
Expand Down
2 changes: 2 additions & 0 deletions docs/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"changelog.md": {
"Changelog Alexa": "Changelog Alexa",
"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",
"Correction d'un bug sur l'inversion des volets": "",
"06\/11\/2024": "06\/11\/2024",
"Correction d'un soucis avec PHP8": "Fixed an issue with PHP8",
"23\/09\/2024": "09\/23\/2024",
"Correction d'un bug sur jeedom 4.4": "Fixed a bug on jeedom 4.4",
Expand Down
2 changes: 2 additions & 0 deletions docs/i18n/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"changelog.md": {
"Changelog Alexa": "Registro de cambios Alexa",
"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": "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",
"Correction d'un bug sur l'inversion des volets": "",
"06\/11\/2024": "11\/06\/2024",
"Correction d'un soucis avec PHP8": "Se solucionó un problema con PHP8",
"23\/09\/2024": "23\/09\/2024",
"Correction d'un bug sur jeedom 4.4": "Se corrigió un error en Jeedom 4.4",
Expand Down
2 changes: 2 additions & 0 deletions docs/i18n/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"Changelog Alexa": "Changelog Alexa",
"IMPORTANT": "IMPORTANT",
"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": "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",
"Correction d'un bug sur l'inversion des volets": "Correction d'un bug sur l'inversion des volets",
"06\/11\/2024": "06\/11\/2024",
"Correction d'un soucis avec PHP8": "Correction d'un soucis avec PHP8",
"23\/09\/2024": "23\/09\/2024",
"Correction d'un bug sur jeedom 4.4": "Correction d'un bug sur jeedom 4.4",
Expand Down
2 changes: 2 additions & 0 deletions docs/i18n/pt_PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"changelog.md": {
"Changelog Alexa": "Changelog Alexa",
"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": "Como lembrete, se não houver informações sobre a atualização, isso significa que se trata apenas da atualização da documentação, tradução ou texto",
"Correction d'un bug sur l'inversion des volets": "",
"06\/11\/2024": "11\/06\/2024",
"Correction d'un soucis avec PHP8": "Corrigido um problema com PHP8",
"23\/09\/2024": "23\/09\/2024",
"Correction d'un bug sur jeedom 4.4": "Corrigido um bug no Jeedom 4.4",
Expand Down
4 changes: 4 additions & 0 deletions docs/pt_PT/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
>
>Como lembrete, se não houver informações sobre a atualização, isso significa que se trata apenas da atualização da documentação, tradução ou texto

-

# 11/06/2024

- Corrigido um problema com PHP8

# 23/09/2024
Expand Down
Loading