Skip to content
Merged
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
3 changes: 2 additions & 1 deletion core/class/gsh.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ public static function getSupportedType() {
'action.devices.types.REMOTECONTROL' => array('name' => __('Télécommande', __FILE__), 'traits' => array('OnOff', 'MediaState', 'InputSelector', 'AppSelector', 'TransportControl', 'Volume')),
'action.devices.types.ROUTER' => array('name' => __('Routeur', __FILE__), 'traits' => array('Modes', 'Toggles', 'Reboot', 'SoftwareUpdate', 'NetworkControl')),
'action.devices.types.SCENE' => array('name' => __('Scène', __FILE__), 'class' => 'gsh_scene'),
'action.devices.types.SECURITYSYSTEM' => array('name' => __('Alarme', __FILE__), 'traits' => array('ArmDisarm', 'StatusReport', 'Modes')),
'action.devices.types.SECURITYSYSTEM' => array('name' => __('Alarme', __FILE__), 'traits' => array('ArmDisarm', 'StatusReport')),
'action.devices.types.SENSOR' => array('name' => __('Capteur', __FILE__), 'traits' => array('OnOff', 'SensorState', 'TemperatureControl', 'Brightness', 'HumiditySetting', 'OccupancySensing')),
'action.devices.types.SETTOP' => array('name' => __('Décodeur', __FILE__), 'traits' => array('AppSelector', 'InputSelector', 'MediaState', 'OnOff', 'TransportControl', 'Volume', 'Channel')),
'action.devices.types.SHOWER' => array('name' => __('Douche', __FILE__), 'traits' => array('Modes', 'Toggles', 'OnOff', 'TemperatureControl')),
'action.devices.types.SHUTTER' => array('name' => __('Volet', __FILE__), 'traits' => array('Modes', 'OpenClose', 'Rotation')),
'action.devices.types.SMOKE_DETECTOR' => array('name' => __('Détecteur de fumée', __FILE__), 'traits' => array('SensorState')),
Expand Down
2 changes: 1 addition & 1 deletion core/class/gsh_FanSpeed.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function query($_device, $_infos){
if (isset($_infos['customData']['FanSpeed_cmdGet'])) {
$cmd = cmd::byId($_infos['customData']['FanSpeed_cmdGet']);
if (is_object($cmd)) {
$return['currentFanSpeedPercent'] = $cmd->execCmd()/ 100 * ($cmd->getConfiguration('maxValue', 100) - $cmd->getConfiguration('minValue', 0));
$return['currentFanSpeedPercent'] = intval($cmd->execCmd())/ 100 * ($cmd->getConfiguration('maxValue', 100) - $cmd->getConfiguration('minValue', 0));
if($return['currentFanSpeedPercent'] > 75){
$return['currentFanSpeedSetting'] = '100';
}elseif($return['currentFanSpeedPercent'] > 50){
Expand Down
8 changes: 7 additions & 1 deletion core/class/gsh_TemperatureSetting.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,13 @@ public static function query($_device, $_infos){
$return['thermostatTemperatureSetpoint'] = 0;
}
if (!isset($return['thermostatMode'])) {
$return['thermostatMode'] = ($_device->getOptions('TemperatureSetting::heat') == '') ? 'cool' : 'heat';
$cmd = cmd::byId($_infos['customData']['TemperatureSetting_cmdGetMode']);//Récupération du mode actuel
if (is_object($cmd)) {
$mode = $cmd->execCmd();
} else {// Mode par défaut si non spécifié dans les generics
$mode = 'heat';
}
$return['thermostatMode'] = $mode;
}
$return['activeThermostatMode'] = $return['thermostatMode'];
if($return['activeThermostatMode'] == 'off'){
Expand Down
1 change: 1 addition & 0 deletions core/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Szene",
"Alarme": "Alarm",
"Capteur": "Sensor",
"Décodeur": "Decoder",
"Douche": "Dusche",
"Volet": "Klappe",
"Détecteur de fumée": "Rauchmelder",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Scene",
"Alarme": "Alarm",
"Capteur": "Sensor",
"Décodeur": "Decoder",
"Douche": "Shower",
"Volet": "Shutter",
"Détecteur de fumée": "Smoke detector",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Escena",
"Alarme": "Alarma",
"Capteur": "Sensor",
"Décodeur": "Descifrador",
"Douche": "Ducha",
"Volet": "Persiana",
"Détecteur de fumée": "Detector de humo",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Scène",
"Alarme": "Alarme",
"Capteur": "Capteur",
"Décodeur": "Décodeur",
"Douche": "Douche",
"Volet": "Volet",
"Détecteur de fumée": "Détecteur de fumée",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/id_ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Scene",
"Alarme": "Alarme",
"Capteur": "Capteur",
"Décodeur": "Décodeur",
"Douche": "Douche",
"Volet": "Penutup",
"Détecteur de fumée": "Détecteur de fumée",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Scene",
"Alarme": "Alarme",
"Capteur": "Capteur",
"Décodeur": "Décodeur",
"Douche": "Douche",
"Volet": "Falda",
"Détecteur de fumée": "Détecteur de fumée",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Scene",
"Alarme": "Alarme",
"Capteur": "Capteur",
"Décodeur": "Décodeur",
"Douche": "Douche",
"Volet": "フラップ",
"Détecteur de fumée": "Détecteur de fumée",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/pt_PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Cena",
"Alarme": "Alarme",
"Capteur": "Sensor",
"Décodeur": "Decodificador",
"Douche": "Chuveiro",
"Volet": "Aba",
"Détecteur de fumée": "Detector de fumaça",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Scene",
"Alarme": "Alarme",
"Capteur": "Capteur",
"Décodeur": "Décodeur",
"Douche": "Douche",
"Volet": "створка",
"Détecteur de fumée": "Détecteur de fumée",
Expand Down
1 change: 1 addition & 0 deletions core/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"Scène": "Scene",
"Alarme": "Alarme",
"Capteur": "Capteur",
"Décodeur": "Décodeur",
"Douche": "Douche",
"Volet": "Kepenek",
"Détecteur de fumée": "Détecteur de fumée",
Expand Down
43 changes: 28 additions & 15 deletions core/php/jeeGshOauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
*/
require_once __DIR__ . '/../../../../core/php/core.inc.php';
$error = '';
$mfa = false;

if (init('response_type') == 'code') {
include_file('core', 'authentification', 'php');
Expand All @@ -23,19 +25,19 @@
// If login and password supplied, try to login the user
if (init('username', '') != '' || init('password', '') != '') {
$user = user::connect(init('username'), init('password'));
if (is_object($user)
&& network::getUserLocation() != 'internal'
&& $user->getOptions('twoFactorAuthentification', 0) == 1
&& $user->getOptions('twoFactorAuthentificationSecret') != ''
&& init('twoFactorCode') == '') {
if (
is_object($user)
&& network::getUserLocation() != 'internal'
&& $user->getOptions('twoFactorAuthentification', 0) == 1
&& $user->getOptions('twoFactorAuthentificationSecret') != ''
&& init('twoFactorCode') == ''
) {
$error = __("Merci de fournir un Token 2FA", __FILE__);
$mfa = true;

} elseif (!login(init('username'), init('password'), init('twoFactorCode'))) {
$error = __("Mot de passe ou nom d'utilisateur incorrect", __FILE__);
}
} else {
$error = '';
}
}

Expand All @@ -61,7 +63,7 @@
<center>
<img src='/core/img/logo-jeedom-petit-nom-couleur-128x128.png' /><br/><br/>
<?php
if ($error != ''){
if ($error != '') {
echo '<div class="alert alert-danger" role="alert" style="margin:10px">' . $error . '</div>';
}
?>
Expand All @@ -79,16 +81,16 @@
</div></div>
<?php
}
foreach(array('response_type', 'client_id', 'redirect_uri', 'state') as $param) {
foreach (array('response_type', 'client_id', 'redirect_uri', 'state') as $param) {
$value = init($param);
if($value != '')
echo ' <input type="hidden" name="'. htmlspecialchars($param) .'" value="'. htmlspecialchars($value) .'" />';
if ($value != '') {
echo '<input type="hidden" name="' . htmlspecialchars($param) . '" value="' . htmlspecialchars($value) . '" />';
}
}
?>
<button type="submit" class="btn btn-primary mb-2">{{Valider}}</button>
</form>
</center>
<pre><?php print_r($_REQUEST); ?></pre>
</body>
</html>
<?php
Expand All @@ -99,7 +101,10 @@
config::save('OAuthAuthorizationCode', $authorization_code, 'gsh');
header('Location: ' . init('redirect_uri') . '?code=' . $authorization_code . '&state=' . init('state'));
}
} else if ($_POST['client_id'] == config::byKey('gshs::clientId', 'gsh') && $_POST['client_secret'] == config::byKey('gshs::clientSecret', 'gsh')) {
} elseif (
$_POST['client_id'] == config::byKey('gshs::clientId', 'gsh')
&& $_POST['client_secret'] == config::byKey('gshs::clientSecret', 'gsh')
) {
if (!in_array(init('type', 'sh'), array('df', 'sh'))) {
echo 'Le type ne peut etre que sh ou df';
die();
Expand All @@ -108,7 +113,11 @@
header('HTTP/1.1 200 OK');
header('\'Access-Control-Allow-Origin\': *');
header('\'Access-Control-Allow-Headers\': \'Content-Type, Authorization\'');
if ($_POST['grant_type'] == 'authorization_code' && $_POST['code'] == config::byKey('OAuthAuthorizationCode', 'gsh') && config::byKey('OAuthAuthorizationCode', 'gsh') != '') {
if (
$_POST['grant_type'] == 'authorization_code'
&& $_POST['code'] == config::byKey('OAuthAuthorizationCode', 'gsh')
&& config::byKey('OAuthAuthorizationCode', 'gsh') != ''
) {
config::save('OAuthAuthorizationCode', '', 'gsh');
$access_token = config::genKey();
config::save('OAuthAccessToken' . init('type', 'sh'), $access_token, 'gsh');
Expand All @@ -121,7 +130,11 @@
'expires_in' => 3600 * 24,
);
echo json_encode($response);
} elseif ($_POST['grant_type'] == 'refresh_token' && $_POST['refresh_token'] == config::byKey('OAuthRefreshToken' . init('type', 'sh'), 'gsh') && config::byKey('OAuthRefreshToken' . init('type', 'sh'), 'gsh') != '') {
} elseif (
$_POST['grant_type'] == 'refresh_token'
&& $_POST['refresh_token'] == config::byKey('OAuthRefreshToken' . init('type', 'sh'), 'gsh')
&& config::byKey('OAuthRefreshToken' . init('type', 'sh'), 'gsh') != ''
) {
$access_token = config::genKey();
config::save('OAuthAccessToken' . init('type', 'sh'), $access_token, 'gsh');
$response = array(
Expand Down
12 changes: 12 additions & 0 deletions docs/de_DE/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
>
>Zur Erinnerung: Wenn keine Informationen zum Update vorhanden sind, bedeutet dies, dass es sich nur um die Aktualisierung von Dokumentation, Übersetzung oder Text handelt

#

-
-
- Fehlerbehebung für PHP8
-

# 11.06.2024

- Fehlerbehebung für PHP8
- Bessere Modusverwaltung

# 24.10.2024

- Ein Fehler bei Modeausrüstung wurde behoben
Expand Down
5 changes: 5 additions & 0 deletions docs/de_DE/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ Die Art der Ausrüstung ist wichtig, damit Google auf die von Ihnen gesagten Sä
> **Wichtig**
>
> Der Thermostat-Typ wird nur durch Geräte unterstützt, die vom Thermostat-Plugin stammen. Andernfalls funktioniert die Verwaltung der Modi möglicherweise nicht
>
> Um den Modus eines Thermostattyps zu verwalten, müssen Sie Folgendes tun :
> - Informationen vom Typ „andere“, die als Wert „Heizen“, „Kühlen“, „Aus“, „Öko“ annehmen und ihm den Typ „Generisch“ zuweisen : Thermostatmodus
> - Aktionen, die Modusänderungen durchführen und ihnen den generischen Typ zuweisen : Thermostatmodus
> - Es ist außerdem erforderlich, die Aktion in den Geräteparametern im gsh-Plugin (Abschnitt „Konfiguration Temperatureinstellung“) mit dem entsprechenden Modus zu verbinden")

## Szenario

Expand Down
12 changes: 12 additions & 0 deletions docs/en_US/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
>
>As a reminder if there is no information on the update, it means that it only concerns the updating of documentation, translation or text

#

-
-
- Bug fix for PHP8
-

# 06/11/2024

- Bug fix for PHP8
- Better mode management

# 10/24/2024

- Fixed a bug on fashion type equipment
Expand Down
5 changes: 5 additions & 0 deletions docs/en_US/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ The types of equipment are important this allows Google to react based on the se
> **Important**
>
> The thermostat type is only fully supported through equipment coming from the thermostat plugin, otherwise the management of the modes may not work
>
> For mode management on a thermostat type, it is necessary :
> - An info of type "other" which takes as value "heat", "cool", "off", "eco" and assigns it the generic type : Thermostat Mode
> - Actions that perform mode changes and assign them the generic type : Thermostat Mode
> - It is also necessary to attach in the equipment settings in the gsh plugin of the action to the corresponding mode (part "Configuration TemperatureSetting")

## Scenario

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

#

-
-
- Corrección de errores para PHP8
-

# 11/06/2024

- Corrección de errores para PHP8
- Mejor gestión de modos

# 24/10/2024

- Se corrigió un error en el equipo de tipo moda
Expand Down
5 changes: 5 additions & 0 deletions docs/es_ES/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ Los tipos de equipos son importantes, esto permite a Google reaccionar en funci
> **Importante**
>
> El tipo de termostato solo es totalmente compatible a través de equipos que provienen del complemento de termostato; de lo contrario, es posible que la administración de los modos no funcione
>
> Para gestionar el modo en un tipo de termostato, debe :
> - Información de tipo "otro" que toma el valor "calor", "frío", "apagado", "eco" y le asigna el tipo genérico : Modo termostato
> - Acciones que realizan cambios de modo y les asignan el tipo genérico : Modo termostato
> - También es necesario conectar la acción al modo correspondiente en los parámetros del equipo en el complemento gsh (sección "Configuración de temperatura")")

## Escenario

Expand Down
11 changes: 9 additions & 2 deletions docs/fr_FR/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
>
>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

# 11/06/2025

- Ajout du type décodeur
- Ajout de la prise en compte des différents modes sur un équipement de type Thermostat
- Correction de bug pour PHP8
- Correction de la gestion du MFA

# 06/11/2024

- Correction de bug pour PHP8
- Meilleure gestion des modes
- Correction de bug pour PHP8
- Meilleure gestion des modes

# 24/10/2024

Expand Down
5 changes: 5 additions & 0 deletions docs/fr_FR/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ Les types d'équipements sont importants cela permet à Google de réagir en fon
> **IMPORTANT**
>
> Le type thermostat n'est pleinement supporté qu'à travers un équipement venant du plugin thermostat, dans le cas contraire la gestion des modes risque de ne pas marcher
>
> Pour la gestion du mode sur un type thermostat, il faut :
> - Une info de type "autre" qui prend comme valeur "heat", "cool", "off", "eco" et lui affecter le type generic : Thermostat Mode
> - Des actions qui réalisent les changements de mode et leur affecter le type generic : Thermostat Mode
> - Il faut également rattacher dans les paramètres de l'équipement dans le plugin gsh de l'action au mode correspondant (partie "Configuration TemperatureSetting")

## Scénario

Expand Down
12 changes: 12 additions & 0 deletions docs/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"changelog.md": {
"Changelog Google Smarthome": "Changelog Google Smarthome",
"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",
"11\/06\/2025": "",
"Ajout du type décodeur": "",
"Ajout de la prise en compte des différents modes sur un équipement de type Thermostat": "",
"Correction de bug pour PHP8": "Fehlerbehebung für PHP8",
"Correction de la gestion du MFA": "",
"06\/11\/2024": "11.06.2024",
"Meilleure gestion des modes": "Bessere Modusverwaltung",
"24\/10\/2024": "24.10.2024",
"Correction d'un bug sur les équipements de type mode": "Ein Fehler bei Modeausrüstung wurde behoben",
"Correction sur les équipements de type Thermostat": "Korrektur bei Geräten vom Typ Thermostat",
Expand Down Expand Up @@ -265,6 +272,11 @@
"Les types d'équipements sont importants cela permet à Google de réagir en fonction des phrases que vous dites": "Die Art der Ausrüstung ist wichtig, damit Google auf die von Ihnen gesagten Sätze reagieren kann",
"Jeedom supporte des types \"béta\" non encore documentés chez Google donc qui peuvent marcher ou non en fonction des mises à jour chez google": "Jeedom unterstützt „Beta“-Typen, die bei Google noch nicht dokumentiert sind, sodass diese je nach Aktualisierungen bei Google möglicherweise funktionieren oder auch nicht",
"Le type thermostat n'est pleinement supporté qu'à travers un équipement venant du plugin thermostat, dans le cas contraire la gestion des modes risque de ne pas marcher": "Der Thermostat-Typ wird nur durch Geräte unterstützt, die vom Thermostat-Plugin stammen. Andernfalls funktioniert die Verwaltung der Modi möglicherweise nicht",
"Pour la gestion du mode sur un type thermostat, il faut": "Um den Modus eines Thermostattyps zu verwalten, müssen Sie Folgendes tun",
"Une info de type \"autre\" qui prend comme valeur \"heat\", \"cool\", \"off\", \"eco\" et lui affecter le type generic": "Informationen vom Typ „andere“, die als Wert „Heizen“, „Kühlen“, „Aus“, „Öko“ annehmen und ihm den Typ „Generisch“ zuweisen",
"Thermostat Mode": "Thermostatmodus",
"Des actions qui réalisent les changements de mode et leur affecter le type generic": "Aktionen, die Modusänderungen durchführen und ihnen den generischen Typ zuweisen",
"Il faut également rattacher dans les paramètres de l'équipement dans le plugin gsh de l'action au mode correspondant (partie \"Configuration TemperatureSetting": "Es ist außerdem erforderlich, die Aktion in den Geräteparametern im gsh-Plugin (Abschnitt „Konfiguration Temperatureinstellung“) mit dem entsprechenden Modus zu verbinden",
"Scénario": "Szenario",
"Vous pouvez aussi créer des scènes dans l'onglet scènario, avec des actions d'entrée et de sortie": "Sie können im Szenario-Tab auch Szenen mit Ein- und Ausstiegsaktionen erstellen",
"Pour lancer un scénario il suffit de dire \"Active": "Um ein Szenario zu starten, sagen Sie einfach \"Aktiv",
Expand Down
Loading
Loading