diff --git a/salt/beacons/service.py b/salt/beacons/service.py
index <HASH>..<HASH> 100644
--- a/salt/beacons/service.py
+++ b/salt/beacons/service.py
@@ -127,7 +127,7 @@ def beacon(config):
             service_config['emitatstartup'] = True
         if 'onchangeonly' not in service_config:
             service_config['onchangeonly'] = False
-        if 'delay' not in config[service]:
+        if 'delay' not in service_config:
             service_config['delay'] = 0
 
         # We only want to report the nature of the shutdown
diff --git a/tests/unit/beacons/test_sensehat_beacon.py b/tests/unit/beacons/test_sensehat_beacon.py
index <HASH>..<HASH> 100644
--- a/tests/unit/beacons/test_sensehat_beacon.py
+++ b/tests/unit/beacons/test_sensehat_beacon.py
@@ -5,7 +5,7 @@ from __future__ import absolute_import
 
 # Salt testing libs
 from tests.support.unit import skipIf, TestCase
-from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock
+from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock
 from tests.support.mixins import LoaderModuleMockMixin
 
 # Salt libs
Fixing typo in service beacon.  Removing unused import.