Skip to content

Commit

Permalink
SHELLY: Fix AnalogInput Name
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaru committed Mar 14, 2024
1 parent 273c552 commit cadb5ef
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Watchdogd/Shelly/Shelly.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,15 @@
values = json_array_get_array_element ( values, 0 ); /* Array in array */
gdouble energie = json_array_get_double_element ( values, 0 );
gdouble injection = json_array_get_double_element ( values, 1 );
if ( component && !strcmp ( component, "em1data:0" ) )
{ MQTT_Send_AI ( module, vars->EM10_ENERGY, energie, TRUE );
MQTT_Send_AI ( module, vars->EM10_ENERGY, injection, TRUE );
}
if ( component && !strcmp ( component, "em1data:1" ) )
{ MQTT_Send_AI ( module, vars->EM11_ENERGY, energie, TRUE );
MQTT_Send_AI ( module, vars->EM11_ENERGY, injection, TRUE );
if ( component )
{ if (!strcmp ( component, "em1data:0" ) )
{ MQTT_Send_AI ( module, vars->EM10_ENERGY, energie, TRUE );
MQTT_Send_AI ( module, vars->EM10_INJECTION, injection, TRUE );
}
else if (!strcmp ( component, "em1data:1" ) )
{ MQTT_Send_AI ( module, vars->EM11_ENERGY, energie, TRUE );
MQTT_Send_AI ( module, vars->EM11_INJECTION, injection, TRUE );
}
}
}
Thread_send_comm_to_master ( module, TRUE );
Expand Down

0 comments on commit cadb5ef

Please sign in to comment.