Skip to content
Snippets Groups Projects
Unverified Commit e5f914bb authored by ollo69's avatar ollo69 Committed by GitHub
Browse files

Clean up AsusWRT if check (#54896)

parent 3a2afb8b
No related branches found
No related tags found
No related merge requests found
......@@ -49,12 +49,7 @@ _LOGGER = logging.getLogger(__name__)
def _is_file(value) -> bool:
"""Validate that the value is an existing file."""
file_in = os.path.expanduser(str(value))
if not os.path.isfile(file_in):
return False
if not os.access(file_in, os.R_OK):
return False
return True
return os.path.isfile(file_in) and os.access(file_in, os.R_OK)
def _get_ip(host):
......
......@@ -161,7 +161,6 @@ class AsusWrtSensor(CoordinatorEntity, SensorEntity):
"""Return current state."""
descr = self.entity_description
state = self.coordinator.data.get(descr.key)
if state is not None:
if descr.factor and isinstance(state, Number):
return round(state / descr.factor, descr.precision)
if state is not None and descr.factor and isinstance(state, Number):
return round(state / descr.factor, descr.precision)
return state
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment