Clean-up, ordering, constants, and extend of schema (#2903)
* Clean-up, ordering, constants, and extend of schema * Put REQUIREMENTS back and re-add line breaks * Clean-up, ordering, constants, and extend of schema * Extend platform
This commit is contained in:
parent
8fc27cbe43
commit
e8c6e4d561
28 changed files with 232 additions and 228 deletions
|
@ -20,9 +20,14 @@ REQUIREMENTS = ['https://github.com/jamespcole/home-assistant-nzb-clients/'
|
|||
'archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip'
|
||||
'#python-sabnzbd==0.1']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
_THROTTLED_REFRESH = None
|
||||
|
||||
DEFAULT_NAME = 'SABnzbd'
|
||||
DEFAULT_PORT = 8080
|
||||
|
||||
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=1)
|
||||
|
||||
SENSOR_TYPES = {
|
||||
'current_status': ['Status', None],
|
||||
'speed': ['Speed', 'MB/s'],
|
||||
|
@ -38,15 +43,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
vol.Optional(CONF_MONITORED_VARIABLES, default=['current_status']):
|
||||
vol.All(cv.ensure_list, [vol.In(SENSOR_TYPES)]),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.string,
|
||||
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
|
||||
})
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
_THROTTLED_REFRESH = None
|
||||
|
||||
# Return cached results if last scan was less then this time ago.
|
||||
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=1)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue