Merge branch 'v1.13.0'

This commit is contained in:
Nicu Hodos 2025-10-05 12:14:22 +02:00
commit 7150dc08c9
3 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json",
"name": "ha-mqtt",
"version": "1.12.0",
"version": "1.13.0",
"description": "Home Assistant classes for integration with MQTT auto discovery",
"repository": {
"type": "git",

View File

@ -42,8 +42,7 @@ namespace HaESP {
template <class T>
Builder<T>& heapStats(Builder<T>& builder) {
auto heap = new Sensor{ "Heap fragmentation", "heap_fragmentation" };
builder.addDiagnostic(Builder<Sensor>::instance(heap)
builder.addDiagnostic(Builder<Sensor>::instance(new Sensor{ "Heap fragmentation", "heap_fragmentation" })
.withUnitMeasure("%")
.withPrecision(0)
.withValueTemplate("{{ value_json.fragmentation }}")

View File

@ -496,6 +496,11 @@ namespace Ha {
return factoryBuilder(*this);
}
template <typename Callable>
Builder& addPreconfigured(Callable&& factoryBuilder) {
return factoryBuilder(*this);
}
Builder& addConfiguration(Component* c) {
c->entityCategory = "config";
return addSecondary(c);