mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Update const.py added missing millimeter (#6834)
* Update const.py added missing millimeter Added missing millimeter * Fixed UNIT_MILLIMETER in multiple locations.
This commit is contained in:
parent
8dfe1d5220
commit
2894a138e7
5 changed files with 9 additions and 10 deletions
|
@ -4,11 +4,11 @@ from esphome.const import (
|
|||
STATE_CLASS_MEASUREMENT,
|
||||
ICON_ARROW_EXPAND_VERTICAL,
|
||||
DEVICE_CLASS_DISTANCE,
|
||||
UNIT_MILLIMETER,
|
||||
)
|
||||
|
||||
CODEOWNERS = ["@TH-Braemer"]
|
||||
DEPENDENCIES = ["uart"]
|
||||
UNIT_MILLIMETERS = "mm"
|
||||
|
||||
a02yyuw_ns = cg.esphome_ns.namespace("a02yyuw")
|
||||
A02yyuwComponent = a02yyuw_ns.class_(
|
||||
|
@ -17,7 +17,7 @@ A02yyuwComponent = a02yyuw_ns.class_(
|
|||
|
||||
CONFIG_SCHEMA = sensor.sensor_schema(
|
||||
A02yyuwComponent,
|
||||
unit_of_measurement=UNIT_MILLIMETERS,
|
||||
unit_of_measurement=UNIT_MILLIMETER,
|
||||
icon=ICON_ARROW_EXPAND_VERTICAL,
|
||||
accuracy_decimals=0,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
|
|
|
@ -12,13 +12,13 @@ from esphome.const import (
|
|||
STATE_CLASS_MEASUREMENT,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
UNIT_CELSIUS,
|
||||
UNIT_MILLIMETER,
|
||||
ICON_THERMOMETER,
|
||||
)
|
||||
|
||||
from . import RGModel, RG15Resolution, HydreonRGxxComponent
|
||||
|
||||
UNIT_INTENSITY = "intensity"
|
||||
UNIT_MILLIMETERS = "mm"
|
||||
UNIT_MILLIMETERS_PER_HOUR = "mm/h"
|
||||
|
||||
CONF_ACC = "acc"
|
||||
|
@ -85,19 +85,19 @@ CONFIG_SCHEMA = cv.All(
|
|||
),
|
||||
cv.Optional(CONF_RESOLUTION): cv.enum(RG15_RESOLUTION, upper=False),
|
||||
cv.Optional(CONF_ACC): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_MILLIMETERS,
|
||||
unit_of_measurement=UNIT_MILLIMETER,
|
||||
accuracy_decimals=2,
|
||||
device_class=DEVICE_CLASS_PRECIPITATION,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
cv.Optional(CONF_EVENT_ACC): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_MILLIMETERS,
|
||||
unit_of_measurement=UNIT_MILLIMETER,
|
||||
accuracy_decimals=2,
|
||||
device_class=DEVICE_CLASS_PRECIPITATION,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
cv.Optional(CONF_TOTAL_ACC): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_MILLIMETERS,
|
||||
unit_of_measurement=UNIT_MILLIMETER,
|
||||
accuracy_decimals=2,
|
||||
device_class=DEVICE_CLASS_PRECIPITATION,
|
||||
state_class=STATE_CLASS_TOTAL_INCREASING,
|
||||
|
|
|
@ -12,6 +12,7 @@ from esphome.const import (
|
|||
CONF_TEMPERATURE,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
UNIT_CELSIUS,
|
||||
UNIT_MILLIMETER,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
CONF_BATTERY_LEVEL,
|
||||
DEVICE_CLASS_BATTERY,
|
||||
|
@ -25,8 +26,6 @@ ICON_PROPANE_TANK = "mdi:propane-tank"
|
|||
|
||||
TANK_TYPE_CUSTOM = "CUSTOM"
|
||||
|
||||
UNIT_MILLIMETER = "mm"
|
||||
|
||||
|
||||
def small_distance(value):
|
||||
"""small_distance is stored in mm"""
|
||||
|
|
|
@ -12,6 +12,7 @@ from esphome.const import (
|
|||
CONF_TEMPERATURE,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
UNIT_CELSIUS,
|
||||
UNIT_MILLIMETER,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
CONF_BATTERY_LEVEL,
|
||||
DEVICE_CLASS_BATTERY,
|
||||
|
@ -26,8 +27,6 @@ ICON_PROPANE_TANK = "mdi:propane-tank"
|
|||
|
||||
TANK_TYPE_CUSTOM = "CUSTOM"
|
||||
|
||||
UNIT_MILLIMETER = "mm"
|
||||
|
||||
|
||||
def small_distance(value):
|
||||
"""small_distance is stored in mm"""
|
||||
|
|
|
@ -1035,6 +1035,7 @@ UNIT_MICROSIEMENS_PER_CENTIMETER = "µS/cm"
|
|||
UNIT_MICROSILVERTS_PER_HOUR = "µSv/h"
|
||||
UNIT_MICROTESLA = "µT"
|
||||
UNIT_MILLIGRAMS_PER_CUBIC_METER = "mg/m³"
|
||||
UNIT_MILLIMETER = "mm"
|
||||
UNIT_MILLISECOND = "ms"
|
||||
UNIT_MILLISIEMENS_PER_CENTIMETER = "mS/cm"
|
||||
UNIT_MINUTE = "min"
|
||||
|
|
Loading…
Reference in a new issue