Add and use UNIT_VOLT constant (#33994)
* Add and use UNIT_VOLT constant * Run isort
This commit is contained in:
1 parent
32e87fc4c7
commit
04c4501455
22 files changed
+125
-64
No files matched your search
@@ -6,7 +6,7 @@ import logging
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_DISPLAY_OPTIONS, CONF_NAME, TEMP_CELSIUS
|
||||
from homeassistant.const import CONF_DISPLAY_OPTIONS, CONF_NAME, TEMP_CELSIUS, UNIT_VOLT
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
@@ -31,10 +31,10 @@ SENSOR_TYPES = {
|
||||
"magnetometer_z": ["magnetometer_z", " ", "mdi:magnet"],
|
||||
"temperature": ["temperature", TEMP_CELSIUS, "mdi:thermometer"],
|
||||
"pressure": ["pressure", "hPa", "mdi:gauge"],
|
||||
"voltage_0": ["voltage_0", "V", "mdi:flash"],
|
||||
"voltage_1": ["voltage_1", "V", "mdi:flash"],
|
||||
"voltage_2": ["voltage_2", "V", "mdi:flash"],
|
||||
"voltage_3": ["voltage_3", "V", "mdi:flash"],
|
||||
"voltage_0": ["voltage_0", UNIT_VOLT, "mdi:flash"],
|
||||
"voltage_1": ["voltage_1", UNIT_VOLT, "mdi:flash"],
|
||||
"voltage_2": ["voltage_2", UNIT_VOLT, "mdi:flash"],
|
||||
"voltage_3": ["voltage_3", UNIT_VOLT, "mdi:flash"],
|
||||
}
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
|
||||
Reference in new issue
Block a user