1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Better handle file not found when loading YAML (#23908)

* Better handle file not found

* Lint
This commit is contained in:
Paulus Schoutsen
2019-05-19 12:01:29 +02:00
committed by GitHub
parent f991ec15f2
commit e356d0bcda
4 changed files with 11 additions and 11 deletions

View File

@@ -1,6 +1,5 @@
"""APNS Notification platform."""
import logging
import os
import voluptuous as vol
@@ -149,7 +148,8 @@ class ApnsNotificationService(BaseNotificationService):
self.devices = {}
self.device_states = {}
self.topic = topic
if os.path.isfile(self.yaml_path):
try:
self.devices = {
str(key): ApnsDevice(
str(key),
@@ -160,6 +160,8 @@ class ApnsNotificationService(BaseNotificationService):
for (key, value) in
load_yaml_config_file(self.yaml_path).items()
}
except FileNotFoundError:
pass
tracking_ids = [
device.full_tracking_device_id