Remove redundant open modes (#33652)

This commit is contained in:
Franck Nijhof 2020-04-04 22:49:15 +02:00 committed by GitHub
parent fddaea797e
commit 22ae498f3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 12 deletions

View file

@ -176,7 +176,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
# We have an owfs mounted
else:
for family_file_path in glob(os.path.join(base_dir, "*", "family")):
with open(family_file_path, "r") as family_file:
with open(family_file_path) as family_file:
family = family_file.read()
if "EF" in family:
continue
@ -218,7 +218,7 @@ class OneWire(Entity):
def _read_value_raw(self):
"""Read the value as it is returned by the sensor."""
with open(self._device_file, "r") as ds_device_file:
with open(self._device_file) as ds_device_file:
lines = ds_device_file.readlines()
return lines