Add and use UNIT_VOLT constant (#33994)

* Add and use UNIT_VOLT constant

* Run isort
This commit is contained in:
springstan authored and GitHub committed 2020-04-11 02:04:58 +02:00
1 parent 32e87fc4c7
commit 04c4501455
22 files changed
+125 -64

No files matched your search

+10 -4
View File
@@ -8,7 +8,13 @@ from pyownet import protocol
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_PORT, TEMP_CELSIUS, UNIT_PERCENTAGE
from homeassistant.const import (
CONF_HOST,
CONF_PORT,
TEMP_CELSIUS,
UNIT_PERCENTAGE,
UNIT_VOLT,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -75,9 +81,9 @@ SENSOR_TYPES = {
"counter_a": ["counter", "count"],
"counter_b": ["counter", "count"],
"HobbyBoard": ["none", "none"],
"voltage": ["voltage", "V"],
"voltage_VAD": ["voltage", "V"],
"voltage_VDD": ["voltage", "V"],
"voltage": ["voltage", UNIT_VOLT],
"voltage_VAD": ["voltage", UNIT_VOLT],
"voltage_VDD": ["voltage", UNIT_VOLT],
"current": ["current", "A"],
}