Secure ATTR_ and CONF_ use identical texts in Modbus (#66901)

This commit is contained in:
jan iversen 2022-02-25 17:05:19 +01:00 committed by GitHub
parent 5c4b149f50
commit adc4c1e33f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View File

@ -11,6 +11,7 @@ from homeassistant.components.climate.const import (
SUPPORT_TARGET_TEMPERATURE,
)
from homeassistant.const import (
ATTR_TEMPERATURE,
CONF_NAME,
CONF_TEMPERATURE_UNIT,
PRECISION_TENTHS,
@ -26,7 +27,6 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import get_hub
from .base_platform import BaseStructPlatform
from .const import (
ATTR_TEMPERATURE,
CALL_TYPE_REGISTER_HOLDING,
CALL_TYPE_WRITE_REGISTERS,
CONF_CLIMATES,

View File

@ -2,6 +2,7 @@
from enum import Enum
from homeassistant.const import (
CONF_ADDRESS,
CONF_BINARY_SENSORS,
CONF_COVERS,
CONF_LIGHTS,
@ -64,13 +65,11 @@ UDP = "udp"
# service call attributes
ATTR_ADDRESS = "address"
ATTR_HUB = "hub"
ATTR_ADDRESS = CONF_ADDRESS
ATTR_HUB = CONF_HUB
ATTR_UNIT = "unit"
ATTR_SLAVE = "slave"
ATTR_VALUE = "value"
ATTR_STATE = "state"
ATTR_TEMPERATURE = "temperature"
class DataType(str, Enum):

View File

@ -20,6 +20,7 @@ from pymodbus.transaction import ModbusRtuFramer
import voluptuous as vol
from homeassistant.const import (
ATTR_STATE,
CONF_DELAY,
CONF_HOST,
CONF_METHOD,
@ -40,7 +41,6 @@ from .const import (
ATTR_ADDRESS,
ATTR_HUB,
ATTR_SLAVE,
ATTR_STATE,
ATTR_UNIT,
ATTR_VALUE,
CALL_TYPE_COIL,

View File

@ -26,7 +26,6 @@ from homeassistant.components.modbus.const import (
ATTR_ADDRESS,
ATTR_HUB,
ATTR_SLAVE,
ATTR_STATE,
ATTR_UNIT,
ATTR_VALUE,
CALL_TYPE_COIL,
@ -67,6 +66,7 @@ from homeassistant.components.modbus.validators import (
)
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (
ATTR_STATE,
CONF_ADDRESS,
CONF_BINARY_SENSORS,
CONF_COUNT,