From 0a186650bf2ac83f2ebeb9e7c44bfa718bf1303d Mon Sep 17 00:00:00 2001
From: Jason Hu <awarecan@users.noreply.github.com>
Date: Sun, 1 Jul 2018 10:04:12 -0700
Subject: [PATCH] Fix an issue when user's nest developer account don't have
 permission (#15237)

---
 homeassistant/components/binary_sensor/nest.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/homeassistant/components/binary_sensor/nest.py b/homeassistant/components/binary_sensor/nest.py
index 9da352e1268..31460c1eedc 100644
--- a/homeassistant/components/binary_sensor/nest.py
+++ b/homeassistant/components/binary_sensor/nest.py
@@ -31,12 +31,10 @@ CAMERA_BINARY_TYPES = {
 
 STRUCTURE_BINARY_TYPES = {
     'away': None,
-    # 'security_state', # pending python-nest update
 }
 
 STRUCTURE_BINARY_STATE_MAP = {
     'away': {'away': True, 'home': False},
-    'security_state': {'deter': True, 'ok': False},
 }
 
 _BINARY_TYPES_DEPRECATED = [
@@ -135,7 +133,7 @@ class NestBinarySensor(NestSensorDevice, BinarySensorDevice):
         value = getattr(self.device, self.variable)
         if self.variable in STRUCTURE_BINARY_TYPES:
             self._state = bool(STRUCTURE_BINARY_STATE_MAP
-                               [self.variable][value])
+                               [self.variable].get(value))
         else:
             self._state = bool(value)
 
-- 
GitLab