Skip to content

Commit

Permalink
Merge pull request #11 from ticed35/master
Browse files Browse the repository at this point in the history
v1.4 Master to release
  • Loading branch information
ticed35 authored Dec 3, 2017
2 parents 2b6494f + 076e01f commit 5941b00
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 5 deletions.
8 changes: 7 additions & 1 deletion core/class/sonybravia.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ public static function dependancy_install() {
if (file_exists(jeedom::getTmpFolder('sonybravia') . '/dependance')) {
return;
}
self::dependancy_force();
log::remove(__CLASS__ . '_update');
return array('script' => dirname(__FILE__) . '/../../resources/install_#stype#.sh ' . jeedom::getTmpFolder('sonybravia') . '/dependance', 'log' => log::getPathToLog(__CLASS__ . '_update'));
}

public static function dependancy_force() {
log::add('sonybravia', 'info', 'Dependancy manual install');
return array('script' => dirname(__FILE__) . '/../../resources/install_dependancy.sh ' . jeedom::getTmpFolder('sonybravia') . '/dependance', 'log' => log::getPathToLog(__CLASS__ . '_update'));
}

public static function deamon_info() {
$return = array();
Expand Down Expand Up @@ -360,4 +366,4 @@ public function execute($_options = null) {
/* * **********************Getteur Setteur*************************** */
}

?>
?>
90 changes: 90 additions & 0 deletions desktop/css/sonybravia.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
Created on : 29 nov. 2017, 09:30:59
Author : ticed
*/
[type="checkbox"][data-l1key="configuration"]:not(:checked),
[type="checkbox"][data-l1key="configuration"]:checked {
position: absolute;
left: -9999px;
}
[type="checkbox"][data-l1key="configuration"]:not(:checked) + label,
[type="checkbox"][data-l1key="configuration"]:checked + label {
position: relative;
padding-left: 75px;
cursor: pointer;
}
[type="checkbox"][data-l1key="configuration"]:not(:checked) + label:before,
[type="checkbox"][data-l1key="configuration"]:checked + label:before,
[type="checkbox"][data-l1key="configuration"]:not(:checked) + label:after,
[type="checkbox"][data-l1key="configuration"]:checked + label:after {
content: '';
position: absolute;
}
[type="checkbox"][data-l1key="configuration"]:not(:checked) + label:before,
[type="checkbox"][data-l1key="configuration"]:checked + label:before {
left:0; top: -3px;
width: 65px; height: 30px;
background: #DDDDDD;
border-radius: 15px;
-webkit-transition: background-color .2s;
-moz-transition: background-color .2s;
-ms-transition: background-color .2s;
transition: background-color .2s;
}
[type="checkbox"][data-l1key="configuration"]:not(:checked) + label:after,
[type="checkbox"][data-l1key="configuration"]:checked + label:after {
width: 20px; height: 20px;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
transition: all .2s;
border-radius: 50%;
background: #d9534f;
top: 2px; left: 5px;
}

/* on checked */
[type="checkbox"][data-l1key="configuration"]:checked + label:before {
background:#DDDDDD;
}
[type="checkbox"][data-l1key="configuration"]:checked + label:after {
background: #62c462;
top: 2px; left: 40px;
}

[type="checkbox"][data-l1key="configuration"]:checked + label .ui,
[type="checkbox"][data-l1key="configuration"]:not(:checked) + label .ui:before,
[type="checkbox"][data-l1key="configuration"]:checked + label .ui:after {
position: absolute;
left: 6px;
width: 65px;
border-radius: 15px;
font-size: 14px;
font-weight: bold;
line-height: 22px;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
transition: all .2s;
}
[type="checkbox"][data-l1key="configuration"]:not(:checked) + label .ui:before {
content: "no";
left: 32px
}
[type="checkbox"][data-l1key="configuration"]:checked + label .ui:after {
content: "yes";
color: #62c462;
}
[type="checkbox"][data-l1key="configuration"]:focus + label:before {
border: 1px dashed #777;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
margin-top: -1px;
}
9 changes: 6 additions & 3 deletions desktop/php/sonybravia.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div style="margin-top:10px" class="col-sm-3">
Si ce mode ne fonctionne pas, passer au mode PIN : <br/>
<input type="checkbox" id="checkbox_psk" class="eqLogicAttr" data-l1key="configuration" data-l2key="pin" placeholder="{{}}"/> Mode PIN
Si ce mode ne fonctionne pas, passer au mode PIN : <br/><br/>
<div style="margin-left: 0px">
<input type="checkbox" id="checkbox_psk" class="eqLogicAttr" data-l1key="configuration" data-l2key="pin" placeholder="{{}}"/>
<label for="checkbox_psk"> Actif </label>
</div>
</div>
</div>

Expand Down Expand Up @@ -256,6 +259,6 @@

</div>
</div>

<?php include_file('desktop', 'sonybravia', 'css', 'sonybravia');?>
<?php include_file('desktop', 'sonybravia', 'js', 'sonybravia');?>
<?php include_file('core', 'plugin.template', 'js');?>
1 change: 1 addition & 0 deletions plugin_info/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function sonybravia_update() {
message::add('sonybravia', 'Mise à jour en cours...', null, null);
if (jeedom::isCapable('sudo')) {
exec(system::getCmdSudo() . ' chmod a+x ' . dirname(__FILE__) . '/../resources/install_apt.sh ' .' 2>&1 &');
exec(system::getCmdSudo() . ' chmod a+x ' . dirname(__FILE__) . '/../resources/install_dependancy.sh ' .' 2>&1 &');
}
else{
message::add('sonybravia', 'Erreur : Veuillez donner les droits sudo à Jeedom', null, null);
Expand Down
2 changes: 2 additions & 0 deletions resources/install_dependancy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sudo apt-get -y install python3
sudo apt-get -y install python3-requests
6 changes: 5 additions & 1 deletion resources/sonybravia_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
from braviarc import BraviaRC
from optparse import OptionParser
from time import sleep
import sys

### Enter the IP address, PSK and MAC address of the TV below
Expand Down Expand Up @@ -81,7 +82,10 @@
if command_type == 'start_app':
_braviainstance.start_app(command_param)
if command_type == 'ircc':
_braviainstance.send_req_ircc(command_param)
cmdlist=command_param.split(";")
for cmdircc in cmdlist :
_braviainstance.send_req_ircc(cmdircc)
sleep(0.25)
sys.exit()
except KeyError:
print('TV not found')
Expand Down

0 comments on commit 5941b00

Please sign in to comment.