Move onewire constants to separate file (#40550)
* Move constants to separate file * Ignore coverage of const.py
This commit is contained in:
parent
f71816d328
commit
f886ea9e3d
3 changed files with 20 additions and 5 deletions
|
@ -606,6 +606,7 @@ omit =
|
||||||
homeassistant/components/omnilogic/__init__.py
|
homeassistant/components/omnilogic/__init__.py
|
||||||
homeassistant/components/omnilogic/common.py
|
homeassistant/components/omnilogic/common.py
|
||||||
homeassistant/components/omnilogic/sensor.py
|
homeassistant/components/omnilogic/sensor.py
|
||||||
|
homeassistant/components/onewire/const.py
|
||||||
homeassistant/components/onewire/sensor.py
|
homeassistant/components/onewire/sensor.py
|
||||||
homeassistant/components/onkyo/media_player.py
|
homeassistant/components/onkyo/media_player.py
|
||||||
homeassistant/components/onvif/__init__.py
|
homeassistant/components/onvif/__init__.py
|
||||||
|
|
12
homeassistant/components/onewire/const.py
Normal file
12
homeassistant/components/onewire/const.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
"""Constants for 1-Wire component."""
|
||||||
|
CONF_MOUNT_DIR = "mount_dir"
|
||||||
|
CONF_NAMES = "names"
|
||||||
|
|
||||||
|
DEFAULT_OWSERVER_PORT = 4304
|
||||||
|
DEFAULT_SYSBUS_MOUNT_DIR = "/sys/bus/w1/devices/"
|
||||||
|
|
||||||
|
DOMAIN = "onewire"
|
||||||
|
|
||||||
|
SUPPORTED_PLATFORMS = [
|
||||||
|
"sensor",
|
||||||
|
]
|
|
@ -20,13 +20,15 @@ from homeassistant.const import (
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
|
||||||
|
from .const import (
|
||||||
|
CONF_MOUNT_DIR,
|
||||||
|
CONF_NAMES,
|
||||||
|
DEFAULT_OWSERVER_PORT,
|
||||||
|
DEFAULT_SYSBUS_MOUNT_DIR,
|
||||||
|
)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF_MOUNT_DIR = "mount_dir"
|
|
||||||
CONF_NAMES = "names"
|
|
||||||
|
|
||||||
DEFAULT_OWSERVER_PORT = 4304
|
|
||||||
DEFAULT_SYSBUS_MOUNT_DIR = "/sys/bus/w1/devices/"
|
|
||||||
DEVICE_SENSORS = {
|
DEVICE_SENSORS = {
|
||||||
# Family : { SensorType: owfs path }
|
# Family : { SensorType: owfs path }
|
||||||
"10": {"temperature": "temperature"},
|
"10": {"temperature": "temperature"},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue