Skip to content

Commit

Permalink
Latest Home Assistant standard
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Jan 18, 2024
1 parent fcfdb8f commit 1d55147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Configuring Hyperion under Configuration -> LED Hardware:
1. Flash Mode: DIO
1. Flash Frequency: 40MHz
1. CPU Frequency: 80 MHz
1. Flash Size: 1M (64K SPIFFS)
1. Flash Size: 1MB (FS:64KB OTA:~470KB)
1. Upload Speed: 115200
1. Port: Select your COM Port of your Serial adapter e.g. COM5
1. Select Sketch > Upload
Expand All @@ -139,7 +139,7 @@ After you have completed the initial flash of the H801 as described above, you w
1. Flash Mode: DIO
1. Flash Frequency: 40MHz
1. CPU Frequency: 80 MHz
1. Flash Size: 1M (64K SPIFFS)
1. Flash Size: 1MB (FS:64KB OTA:~470KB)
1. Upload Speed: 115200
1. In the top bar select "Sketch" --> "Export Compiled Binary", after it completes there schould be a .bin file in the folder where you saved the h801-mqtt-json.ino file.
1. Upload this .bin file to your H801 using first the "Choose File" and then the "Update" button of step 2.
Expand Down
9 changes: 4 additions & 5 deletions h801-mqtt-json.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// #define MQTT_MAX_PACKET_SIZE 128 --> #define MQTT_MAX_PACKET_SIZE 800

#define MQTT_MAX_PACKET_SIZE 800
#define FIRMWARE_VERSION "2.0.0"
#define FIRMWARE_VERSION "2.0.1"
#define MANUFACTURER "Huacanxing"

#include <string>
Expand Down Expand Up @@ -40,7 +40,7 @@ ESP8266HTTPUpdateServer httpUpdater;

/********************************** program variables *****************************************/
char chip_id[9] = "00000000";
char* myhostname = "esp00000000";
char myhostname[] = "esp00000000";
IPAddress ip;
uint8_t reconnect_N = 0;
unsigned long last_publish_ms = 0;
Expand Down Expand Up @@ -375,7 +375,7 @@ void publishJsonDiscovery() {
publishJsonDiscovery_entity("white_single", "white", false, false);
}

void publishJsonDiscovery_entity(char type[], char type_topic[], bool sup_color_temp, bool sup_rgb) {
void publishJsonDiscovery_entity(const char type[], const char type_topic[], bool sup_color_temp, bool sup_rgb) {
StaticJsonDocument<JSON_BUFFER_SIZE> root;
char idendifier[15] = "H801_";
strcat(idendifier, chip_id);
Expand All @@ -386,8 +386,7 @@ void publishJsonDiscovery_entity(char type[], char type_topic[], bool sup_color_
char conf_url[strlen(OTA_update_path)+25] = "http://";
strcat(conf_url, ip.toString().c_str());
strcat(conf_url, OTA_update_path);
char entity_name[strlen(Module_Name)+14] = Module_Name;
strcat(entity_name, " ");
char entity_name[14] = "";
strcat(entity_name, type);

char stat_t[27] = "~/";
Expand Down

0 comments on commit 1d55147

Please sign in to comment.