Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix displaying useless Auto mode in Google Home thermostat #91

Merged
merged 1 commit into from
Oct 24, 2024
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
2 changes: 1 addition & 1 deletion core/class/gsh.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static function getSupportedType() {
'action.devices.types.SPRINKLER' => array('name' => __('Arrosage', __FILE__), 'traits' => array('StartStop')),
'action.devices.types.STANDMIXER' => array('name' => __('Mélangeur sur socle', __FILE__), 'traits' => array('Cook', 'OnOff', 'StartStop')),
'action.devices.types.SWITCH' => array('name' => __('Interrupteur', __FILE__), 'traits' => array('OnOff')),
'action.devices.types.THERMOSTAT' => array('name' => __('Thermostat', __FILE__), 'traits' => array('TemperatureSetting', 'Modes')),
'action.devices.types.THERMOSTAT' => array('name' => __('Thermostat', __FILE__), 'traits' => array('TemperatureSetting')),
'action.devices.types.TV' => array('name' => __('TV', __FILE__), 'traits' => array('OnOff', 'MediaState', 'InputSelector', 'AppSelector', 'TransportControl', 'Volume', 'Modes', 'Channel')),
'action.devices.types.VACUUM' => array('name' => __('Aspirateur', __FILE__), 'traits' => array('Dock', 'Locator', 'Modes', 'OnOff', 'StartStop', 'Toggles', 'RunCycle')),
'action.devices.types.VALVE' => array('name' => __('Vanne', __FILE__), 'traits' => array('OpenClose')),
Expand Down
29 changes: 2 additions & 27 deletions core/class/gsh_TemperatureSetting.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class gsh_TemperatureSetting {

public static function discover($_device,$_eqLogic){
$return = array('traits' => array(),'customData' => array(),'attributes' => array());
$modes = 'auto,';
$modes = '';
if ($_device->getOptions('TemperatureSetting::heat') != '') {
$modes .= 'heat,';
}
Expand All @@ -40,9 +40,6 @@ public static function discover($_device,$_eqLogic){
if ($_device->getOptions('TemperatureSetting::eco') != '') {
$modes .= 'eco,';
}
if ($_device->getOptions('TemperatureSetting::auto') != '') {
#$modes .= 'auto,';
}
if ($_device->getOptions('TemperatureSetting::heatcool') != '') {
$modes .= 'heatcool,';
}
Expand Down Expand Up @@ -158,8 +155,6 @@ public static function exec($_device, $_executions, $_infos){
$cmd = cmd::byId($_device->getOptions('TemperatureSetting::cool'));
} elseif ($execution['params']['thermostatMode'] == 'eco') {
$cmd = cmd::byId($_device->getOptions('TemperatureSetting::eco'));
} elseif ($execution['params']['thermostatMode'] == 'auto') {
$cmd = cmd::byId($_device->getOptions('TemperatureSetting::auto'));
} elseif ($execution['params']['thermostatMode'] == 'heatcool') {
$cmd = cmd::byId($_device->getOptions('TemperatureSetting::heatcool'));
}
Expand Down Expand Up @@ -207,10 +202,7 @@ public static function query($_device, $_infos){
break;
case $_device->getOptions('TemperatureSetting::eco'):
$return['thermostatMode'] = 'eco';
break;
case $_device->getOptions('TemperatureSetting::auto'):
$return['thermostatMode'] = 'auto';
break;
break;;
case $_device->getOptions('TemperatureSetting::heatcool'):
$return['thermostatMode'] = 'heatcool';
break;
Expand All @@ -237,12 +229,6 @@ public static function query($_device, $_infos){
case __('Eco', __FILE__);
$return['thermostatMode'] = 'eco';
break;
case __('Suspendu', __FILE__):
#$return['thermostatMode'] = 'auto';
break;
case __('Arrêté', __FILE__):
#$return['thermostatMode'] = 'auto';
break;
case __('Off', __FILE__):
$return['thermostatMode'] = 'off';
break;
Expand Down Expand Up @@ -353,17 +339,6 @@ public static function getHtmlConfiguration($_eqLogic){
echo '</select>';
echo '</div>';
echo '</div>';
echo '<div class="form-group">';
echo '<label class="col-sm-3 control-label">{{Action pour le mode Autre (non sélectionnable)}}</label>';
echo '<div class="col-sm-3">';
echo '<select class="form-control deviceAttr" data-l1key="options" data-l2key="TemperatureSetting::auto">';
echo '<option value="">{{Aucun}}</option>';
foreach ($_eqLogic->getCmd('action', null, null, true) as $cmd) {
echo '<option value="' . $cmd->getId() . '">' . $cmd->getName() . '</option>';
}
echo '</select>';
echo '</div>';
echo '</div>';
}

}
Loading