Move QNAP constants (#93918)

* Create const.py

* Update sensor.py

* Add docstring

* Update sensor.py

* Update homeassistant/components/qnap/sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update homeassistant/components/qnap/const.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
disforw 2023-06-01 10:13:07 -04:00 committed by GitHub
parent 1a3d6bbb9a
commit 1f0e235b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,6 @@
"""The Qnap constants."""
DEFAULT_PORT = 8080
DEFAULT_TIMEOUT = 5
DOMAIN = "qnap"

View File

@ -35,6 +35,8 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from homeassistant.util import Throttle
from .const import DEFAULT_PORT, DEFAULT_TIMEOUT
_LOGGER = logging.getLogger(__name__)
ATTR_DRIVE = "Drive"
@ -56,9 +58,6 @@ ATTR_VOLUME_SIZE = "Volume Size"
CONF_DRIVES = "drives"
CONF_NICS = "nics"
CONF_VOLUMES = "volumes"
DEFAULT_NAME = "QNAP"
DEFAULT_PORT = 8080
DEFAULT_TIMEOUT = 5
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=1)