Fix: Re-Request grid profile parameters if received data are invalid / to short
Fixes #1874
This commit is contained in:
parent
6f3b8fb8e1
commit
1888054627
@ -114,7 +114,7 @@ void HoymilesClass::loop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fetch grid profile
|
// Fetch grid profile
|
||||||
if (iv->Statistics()->getLastUpdate() > 0 && iv->GridProfile()->getLastUpdate() == 0) {
|
if (iv->Statistics()->getLastUpdate() > 0 && (iv->GridProfile()->getLastUpdate() == 0 || !iv->GridProfile()->containsValidData())) {
|
||||||
iv->sendGridOnProFileParaRequest();
|
iv->sendGridOnProFileParaRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2023 Thomas Basler and others
|
* Copyright (C) 2023 - 2024 Thomas Basler and others
|
||||||
*/
|
*/
|
||||||
#include "GridProfileParser.h"
|
#include "GridProfileParser.h"
|
||||||
#include "../Hoymiles.h"
|
#include "../Hoymiles.h"
|
||||||
@ -446,6 +446,11 @@ std::list<GridProfileSection_t> GridProfileParser::getProfile() const
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GridProfileParser::containsValidData() const
|
||||||
|
{
|
||||||
|
return _gridProfileLength > 6;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t GridProfileParser::getSectionSize(const uint8_t section_id, const uint8_t section_version)
|
uint8_t GridProfileParser::getSectionSize(const uint8_t section_id, const uint8_t section_version)
|
||||||
{
|
{
|
||||||
uint8_t count = 0;
|
uint8_t count = 0;
|
||||||
|
|||||||
@ -43,6 +43,8 @@ public:
|
|||||||
|
|
||||||
std::list<GridProfileSection_t> getProfile() const;
|
std::list<GridProfileSection_t> getProfile() const;
|
||||||
|
|
||||||
|
bool containsValidData() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static uint8_t getSectionSize(const uint8_t section_id, const uint8_t section_version);
|
static uint8_t getSectionSize(const uint8_t section_id, const uint8_t section_version);
|
||||||
static int16_t getSectionStart(const uint8_t section_id, const uint8_t section_version);
|
static int16_t getSectionStart(const uint8_t section_id, const uint8_t section_version);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user