Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions custom_components/sensor/authenticated.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers.entity import Entity

__version__ = '0.3.0'
__version__ = '0.3.1'

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -49,7 +49,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
notify = config.get(CONF_NOTIFY)
exclude = config.get(CONF_EXCLUDE)
logs = {'homeassistant.components.http.view': 'info'}
_LOGGER.debug('Making sure the logger is correct set.')
_LOGGER.debug('Making sure the logger is correctly setup.')
hass.services.call('logger', 'set_level', logs)
log = str(hass.config.path(LOGFILE))
out = str(hass.config.path(OUTFILE))
Expand Down Expand Up @@ -95,7 +95,7 @@ def update(self):
if count != 0:
last_ip = list(log_content)[-1]
for ip_address in log_content:
self.prosess_ip(ip_address, log_content[ip_address]['access'])
self.process_ip(ip_address, log_content[ip_address]['access'])
known_ips = get_outfile_content(self._out)
self._state = last_ip
self._hostname = known_ips[last_ip]['hostname']
Expand All @@ -105,8 +105,8 @@ def update(self):
self._LAT = known_ips[last_ip]['last_authenticated']
self._PAT = known_ips[last_ip]['previous_authenticated_time']

def prosess_ip(self, ip_address, accesstime):
"""Prosess the IP found in the log"""
def process_ip(self, ip_address, accesstime):
"""Process the IP found in the log"""
if not os.path.isfile(self._out):
# First IP
self.add_new_ip(ip_address, accesstime)
Expand Down