From b9398897c1f11eb7ddef665a8cf841099b990399 Mon Sep 17 00:00:00 2001 From: Stewart Date: Thu, 17 Feb 2022 00:53:26 +0000 Subject: [PATCH 1/4] Set entity-category to diagnostic for debug component (#3209) Co-authored-by: Stewart Morgan Co-authored-by: root --- esphome/components/debug/sensor.py | 29 +++++++++++++++++++++---- esphome/components/debug/text_sensor.py | 6 +++-- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/esphome/components/debug/sensor.py b/esphome/components/debug/sensor.py index deea6fd5ed..f7ea07d138 100644 --- a/esphome/components/debug/sensor.py +++ b/esphome/components/debug/sensor.py @@ -6,6 +6,7 @@ from esphome.const import ( CONF_FRAGMENTATION, CONF_BLOCK, CONF_LOOP_TIME, + ENTITY_CATEGORY_DIAGNOSTIC, UNIT_MILLISECOND, UNIT_PERCENT, UNIT_BYTES, @@ -18,14 +19,34 @@ DEPENDENCIES = ["debug"] CONFIG_SCHEMA = { cv.GenerateID(CONF_DEBUG_ID): cv.use_id(DebugComponent), - cv.Optional(CONF_FREE): sensor.sensor_schema(UNIT_BYTES, ICON_COUNTER, 0), - cv.Optional(CONF_BLOCK): sensor.sensor_schema(UNIT_BYTES, ICON_COUNTER, 0), + cv.Optional(CONF_FREE): sensor.sensor_schema( + unit_of_measurement=UNIT_BYTES, + icon=ICON_COUNTER, + accuracy_decimals=0, + entity_category=ENTITY_CATEGORY_DIAGNOSTIC, + ), + cv.Optional(CONF_BLOCK): sensor.sensor_schema( + unit_of_measurement=UNIT_BYTES, + icon=ICON_COUNTER, + accuracy_decimals=0, + entity_category=ENTITY_CATEGORY_DIAGNOSTIC, + ), cv.Optional(CONF_FRAGMENTATION): cv.All( cv.only_on_esp8266, cv.require_framework_version(esp8266_arduino=cv.Version(2, 5, 2)), - sensor.sensor_schema(UNIT_PERCENT, ICON_COUNTER, 1), + sensor.sensor_schema( + unit_of_measurement=UNIT_PERCENT, + icon=ICON_COUNTER, + accuracy_decimals=1, + entity_category=ENTITY_CATEGORY_DIAGNOSTIC, + ), + ), + cv.Optional(CONF_LOOP_TIME): sensor.sensor_schema( + unit_of_measurement=UNIT_MILLISECOND, + icon=ICON_TIMER, + accuracy_decimals=0, + entity_category=ENTITY_CATEGORY_DIAGNOSTIC, ), - cv.Optional(CONF_LOOP_TIME): sensor.sensor_schema(UNIT_MILLISECOND, ICON_TIMER, 0), } diff --git a/esphome/components/debug/text_sensor.py b/esphome/components/debug/text_sensor.py index f8d1016fbf..11e6354f57 100644 --- a/esphome/components/debug/text_sensor.py +++ b/esphome/components/debug/text_sensor.py @@ -1,7 +1,7 @@ from esphome.components import text_sensor import esphome.config_validation as cv import esphome.codegen as cg -from esphome.const import CONF_DEVICE +from esphome.const import CONF_DEVICE, ENTITY_CATEGORY_DIAGNOSTIC from . import CONF_DEBUG_ID, DebugComponent @@ -11,7 +11,9 @@ DEPENDENCIES = ["debug"] CONFIG_SCHEMA = cv.Schema( { cv.GenerateID(CONF_DEBUG_ID): cv.use_id(DebugComponent), - cv.Optional(CONF_DEVICE): text_sensor.text_sensor_schema(), + cv.Optional(CONF_DEVICE): text_sensor.text_sensor_schema( + entity_category=ENTITY_CATEGORY_DIAGNOSTIC + ), } ) From 7dcc4d030bb4eb2997eef44453981e0d1515c45c Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 17 Feb 2022 11:56:14 +0100 Subject: [PATCH 2/4] Fix platformio docker version mismstch (#3215) --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5d9decbf1b..6735037c1e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -43,7 +43,7 @@ RUN \ # Ubuntu python3-pip is missing wheel pip3 install --no-cache-dir \ wheel==0.37.1 \ - platformio==5.2.4 \ + platformio==5.2.5 \ # Change some platformio settings && platformio settings set enable_telemetry No \ && platformio settings set check_libraries_interval 1000000 \ From 8886b7e1417823bd12e1f9e37d07ee0c6a28aa1a Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 18 Feb 2022 10:11:22 +1300 Subject: [PATCH 3/4] Add LONG LONG flag for arduinojson (#3212) --- esphome/components/json/json_util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/json/json_util.h b/esphome/components/json/json_util.h index 57fe6107d8..2299a4cfed 100644 --- a/esphome/components/json/json_util.h +++ b/esphome/components/json/json_util.h @@ -4,9 +4,10 @@ #include "esphome/core/helpers.h" -#undef ARDUINOJSON_ENABLE_STD_STRING #define ARDUINOJSON_ENABLE_STD_STRING 1 // NOLINT +#define ARDUINOJSON_USE_LONG_LONG 1 // NOLINT + #include namespace esphome { From 83b7181bcb22262dee690a591099aa036cd06b20 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 18 Feb 2022 10:16:11 +1300 Subject: [PATCH 4/4] Bump version to 2022.2.2 --- esphome/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/const.py b/esphome/const.py index 7d4fc234db..b501428f9e 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -1,6 +1,6 @@ """Constants used by esphome.""" -__version__ = "2022.2.1" +__version__ = "2022.2.2" ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"