Hamburger Hamburger

Heating and Ventilation Control

/HV_RollerShutter

Keine Erläuterungen gefunden.

<?php

$RSfile = "./HVC/ConfDir/RSstate.json";

function HV_RollerShutter_showSwitches(){
    global $RSfile;
    $stObj = readJSON($RSfile);
    $RSstate =dict2param($stObj);
    $RSnames = array_keys($RSstate);

    $html = "<div>\n";
    $html.= "<form method='POST' action='?what2do=writeRS'>\n";
    $html.= "<table class='color'>\n";
    for($rs=0;$rs<count($RSnames);$rs++){
        $html.= switchPanel($RSnames[$rs], $RSstate[$RSnames[$rs]]);
    }
    $html.= "</table>\n";
    $html.= "</form>\n</div>\n";
    return $html;
}

function switchPanel($name, $state){  
    $html = "<tr><td>".$name."</td>";
    if($state=="close"){$extraStyle="style='color:black; background-color:yellow;'";}else{$extraStyle = "";}
    $html.= "<td><button class='formField'".$extraStyle."type='submit' name='".$name."' value='close'>close</button></td>";
    if($state=="stop"){$extraStyle="style='color:black; background-color:yellow;'";}else{$extraStyle = "";}
    $html.= "<td><button class='formField'".$extraStyle."type='submit' name='".$name."' value='stop'>stop</button></td>";
    if($state=="open"){$extraStyle="style='color:black; background-color:yellow;'";}else{$extraStyle = "";}
    $html.= "<td><button class='formField'".$extraStyle."type='submit' name='".$name."' value='open'>open</button></td>";
    if($state=="auto"){$extraStyle="style='color:black; background-color:yellow;'";}else{$extraStyle = "";}
    $html.= "<td><button class='formField'".$extraStyle."type='submit' name='".$name."' value='auto'>auto</button></td>";
    $html.= "</tr>";
    return $html;
}



function HV_RollerShutter_POST(){
    global $RSfile;
    $stObj = readJSON($RSfile);
    $RSstate =dict2param($stObj);
    $RSnames = array_keys($RSstate);
    for($rs=0;$rs<count($RSnames);$rs++){
        if(isset($_POST[$RSnames[$rs]])){
            $RSstate[$RSnames[$rs]] = $_POST[$RSnames[$rs]];
        }
    } #rs
    #print_r($RSstate);
    return $RSstate;
}

function HV_RollerShutter_writeRS($RSstates){
    global $RSfile;
    writeJSON($RSstates,$RSfile);
    $html = "<p style='width:100%; text-align:center;'>Rollläden Stati geschrieben.</p>";
    return $html;
}
?>

python

1/HvcLightControl.py
2/HvcHCSR04ultrasonic.py
3/HvcPV.py
4/HvcMotorDriver.py
5/HvcRollerShutter.py
6/manGenMqttMap.py
7/HvcReadSPI.py
8/HvcMqtt.py
9/HvcTables.py
10/HvcMain.py
11/HvcSetGPIO.py
12/HvcWifiRelay.py
13/HvcOperationMode.py
14/HvcControl.py
15/HvcRaw2phys.py
16/HvcWeather.py
17/HvcOneWire.py
18/makeDoc.py
19/HvcFronius.py
20/EnergyManager.py
21/HvcSendI2C.py

php

1/HV_colorMap.php
2/HV_Admin_Login.php
3/HV_readOperationState.php
4/HV_setParameters.php
5/HV_config.php
6/EM_handleJSON.php
7/index.php
8/readFilenames.php
9/HV_restart.php
10/HV_moveGate.php
11/HV_showLog.php
12/HV_RollerShutter.php
13/EM_editParameter.php
14/HV_serviceLog.php
15/HV_H2Olevel.php
16/HV_TempCal.php
17/HV_Fronius.php
18/EM_plot.php
19/readNamedData.php
20/HV_composeH2Oplot.php
21/HVdoc.php
22/HV_showWeatherForecast.php
23/HV_showHouse.php

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.