Skip to content

Commit

Permalink
Merge pull request #18 from custom-components/revert-9-patch-3
Browse files Browse the repository at this point in the history
Revert "Define scan configuration parameter for variable time between executions"
  • Loading branch information
jchasey authored Jun 9, 2021
2 parents eb1515a + 5446b96 commit a43f03a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions custom_components/ssh/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a43f03a

Please sign in to comment.