Importing and showing Rimo Building and Home Status
This commit is contained in:
@@ -246,15 +246,22 @@ foreach ($clusters as $cluster_data) {
|
||||
/*
|
||||
* Set Building Status based on Operational-/Executionstate
|
||||
*/
|
||||
$b_execution_state_id = $building->executionState->name;
|
||||
$b_execution_state_label = $building->executionState->userLabel;
|
||||
$b_executionstate_id = $building->executionState->name;
|
||||
$b_executionstate_label = $building->executionState->userLabel;
|
||||
$b_operationalstate_id = $building->operationalState->name;
|
||||
$b_operationalstate_label = $building->operationalState->userLabel;
|
||||
|
||||
if($b_executionstate_label != $hausnummer->rimo_ex_state) {
|
||||
$hausnummer->rimo_ex_state = $b_executionstate_label;
|
||||
$hausnummer->save();
|
||||
}
|
||||
if($b_operationalstate_label != $hausnummer->rimo_op_state) {
|
||||
$hausnummer->rimo_op_state = $b_operationalstate_label;
|
||||
$hausnummer->save();
|
||||
}
|
||||
|
||||
|
||||
if($b_execution_state_id == "99" && $hausnummer->visibility != "private") {
|
||||
echo "== Setting visibility to private because execution state $b_execution_state_id ($b_execution_state_label) [".$hausnummer->id."]\n";
|
||||
if($b_executionstate_id == "99" && $hausnummer->visibility != "private") {
|
||||
echo "== Setting visibility to private because execution state $b_executionstate_id ($b_executionstate_label) [".$hausnummer->id."]\n";
|
||||
$hausnummer->visibility = "private";
|
||||
$hausnummer->save();
|
||||
}
|
||||
@@ -293,7 +300,7 @@ foreach ($clusters as $cluster_data) {
|
||||
$rimo_home_count = count($building->homes->item);
|
||||
|
||||
foreach ($building->homes->item as $home) {
|
||||
//print_r($home);//exit;
|
||||
//print_r($home);exit;
|
||||
$homes_count++;
|
||||
$home_rimo_id = $home->id;
|
||||
$home_name = $home->name;
|
||||
@@ -331,6 +338,15 @@ foreach ($clusters as $cluster_data) {
|
||||
* TODO: Status based on execution-/operational-state
|
||||
*/
|
||||
|
||||
if($home->executionState->userLabel != $unit->rimo_ex_state) {
|
||||
$unit->rimo_ex_state = $home->executionState->userLabel;
|
||||
$unit->save();
|
||||
}
|
||||
if($home->operationalState->userLabel != $unit->rimo_op_state) {
|
||||
$unit->rimo_op_state = $home->operationalState->userLabel;
|
||||
$unit->save();
|
||||
}
|
||||
|
||||
/*
|
||||
* update FTU data
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user