Modernize invertergui: MQTT write support, HA integration, UI updates
Some checks failed
build / inverter_gui_pipeline (push) Has been cancelled

This commit is contained in:
2026-02-19 12:03:52 +11:00
parent 959d1e3c1f
commit a31a0b4829
460 changed files with 19655 additions and 40205 deletions

View File

@@ -330,6 +330,11 @@ func decodeBytes(b io.Reader) ([]byte, error) {
}
func encodeBytes(field []byte) []byte {
// Attempting to encode more than 65,535 bytes would lead to an unexpected 16-bit length and extra data written
// (which would be parsed as later parts of the message). The safest option is to truncate.
if len(field) > 65535 {
field = field[0:65535]
}
fieldLength := make([]byte, 2)
binary.BigEndian.PutUint16(fieldLength, uint16(len(field)))
return append(fieldLength, field...)