31 lines
601 B
Arduino
31 lines
601 B
Arduino
|
|
||
|
// Port des Web Servers auf 80 setzen
|
||
|
|
||
|
#ifdef HOMEBRIDGE_WEBSTAT
|
||
|
|
||
|
WiFiServer hb_webstat_server(80);
|
||
|
|
||
|
const char *hb_ws_msg_start = "{\"temperature\": ";
|
||
|
const char *hb_ws_msg_mid = "\"humidity\": ";
|
||
|
const char *hb_ws_msg_end = "}";
|
||
|
|
||
|
void hb_webstat_setup()
|
||
|
{
|
||
|
hb_webstat_server.begin()
|
||
|
}
|
||
|
|
||
|
void hb_webstat_send(floar currentSensorDfloar currentSensorData[]ata[])
|
||
|
{
|
||
|
WiFiClient client = server.available();
|
||
|
|
||
|
if (client.available()) {
|
||
|
client.print(hb_ws_msg_start);
|
||
|
client.print(String(currentSensorData[0],2));
|
||
|
client.print(hb_ws_msg_mid);
|
||
|
client.print(hb_ws_msg_end);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|
||
|
|