mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Secure ATTR_ and CONF_ use identical texts in Modbus (#66901)
This commit is contained in:
parent
5c4b149f50
commit
adc4c1e33f
@ -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,
|
||||
|
@ -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):
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user