From bfd8b02f2a05cae60498b2f3a41d6f342dbaa18c Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Wed, 8 Oct 2025 15:32:38 +0200 Subject: [PATCH] upgrade to ha-mqtt v2.0.0 --- include/devices.h | 10 +++++----- include/huzzah.h | 3 ++- include/rc_devices.h | 4 ++-- platformio.ini | 5 +---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/devices.h b/include/devices.h index 100c7a6..33fc740 100644 --- a/include/devices.h +++ b/include/devices.h @@ -4,7 +4,7 @@ using namespace Ha; -auto roomSensor = Builder::instance(TEMP_SENSOR) +auto roomSensor = Builder(TEMP_SENSOR) .asDevice(&DeviceConfig::create(TEMP_SENSOR) .withName("Servers room") .withManufacturer("Atmel") @@ -15,7 +15,7 @@ auto roomSensor = Builder::instance(TEMP_SENSOR) .addPreconfigured(batterySensors(TEMP_SENSOR, BATTERY_PERCENTAGE_TEMPLATE(2.5, 2))) .build(); -auto tankSensor = Builder::instance(new Sensor{ "Level", OIL_SENSOR }) +auto tankSensor = Builder(new Sensor{ "Level", OIL_SENSOR }) .asDevice(&DeviceConfig::create(OIL_SENSOR) .withName("Oil tank") .withManufacturer("Arduino") @@ -27,7 +27,7 @@ auto tankSensor = Builder::instance(new Sensor{ "Level", OIL_SENSOR }) .withIcon("mdi:hydraulic-oil-level") .withValueTemplate("{{ 100 - ((value_json.sensor.value-12)|float*100/120)|round(2) }}") .addSecondary( - Builder::instance(new Sensor{ "Depth", OIL_SENSOR }) + Builder(new Sensor{ "Depth", OIL_SENSOR }) .withDeviceClass("distance") .withUnitMeasure("cm") .withSensorStateClass(MEASUREMENT) @@ -37,7 +37,7 @@ auto tankSensor = Builder::instance(new Sensor{ "Level", OIL_SENSOR }) .addPreconfigured(batterySensors(OIL_SENSOR, BATTERY_PERCENTAGE_TEMPLATE(4, 2.4))) .build(); -auto presenceTracker = Builder::instance(PRESENCE_SENSOR) +auto presenceTracker = Builder(PRESENCE_SENSOR) .asDevice(&DeviceConfig::create(PRESENCE_SENSOR) .withName("Kid presence") .withManufacturer("Atmel") @@ -57,7 +57,7 @@ Command* commands[] = { .addPreconfigured(HaESP::wifiInfo) .build(), #if ENABLE_DOORBELL - Builder