From 5446b9638dd1f34fb5a526e04b41c7ddf26e30dc Mon Sep 17 00:00:00 2001 From: jchasey <35230842+jchasey@users.noreply.github.com> Date: Wed, 9 Jun 2021 14:16:17 +0100 Subject: [PATCH] Revert "Define scan configuration parameter for variable time between executions" --- custom_components/ssh/sensor.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/custom_components/ssh/sensor.py b/custom_components/ssh/sensor.py index 9f40e24..477389c 100644 --- a/custom_components/ssh/sensor.py +++ b/custom_components/ssh/sensor.py @@ -39,7 +39,6 @@ vol.Required(CONF_COMMAND): cv.string, vol.Required(CONF_UNIT_OF_MEASUREMENT): cv.string, vol.Optional(CONF_VALUE_TEMPLATE): cv.template, - vol.Optional(CONF_SCAN, default=MIN_TIME_BETWEEN_UPDATES): cv.string, }) @asyncio.coroutine @@ -62,7 +61,6 @@ def __init__(self, hass, config): self._command = config.get(CONF_COMMAND) self._value_template = config.get(CONF_VALUE_TEMPLATE) self._unit_of_measurement = config.get(CONF_UNIT_OF_MEASUREMENT) - self._scan = config.get(CONF_SCAN) self._ssh = None self._connected = False self._connect() @@ -96,12 +94,7 @@ def unit_of_measurement(self): """Return the unit of measurement of this entity, if any.""" return self._unit_of_measurement - @property - def scan(self): - """Return the period between executions, if any.""" - return self._scan - - @Throttle(self._scan) + @Throttle(MIN_TIME_BETWEEN_UPDATES) def update(self): from pexpect import pxssh, exceptions @@ -135,7 +128,7 @@ def update(self): return None def _connect(self): - """Connect to the SSH server.""" + """Connect to the Unifi AP SSH server.""" from pexpect import pxssh, exceptions self._ssh = pxssh.pxssh()