From 8afd30b7d45f1dd6f7c9bbc9a07fd51a51ba1bf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= <mail@dahoiv.net>
Date: Tue, 6 Dec 2016 03:04:04 +0100
Subject: [PATCH] fix setting battery in device_tracker (#4756)

---
 homeassistant/components/device_tracker/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py
index 7c4c74708db..d497ea4c314 100644
--- a/homeassistant/components/device_tracker/__init__.py
+++ b/homeassistant/components/device_tracker/__init__.py
@@ -421,7 +421,8 @@ class Device(Entity):
         self.host_name = host_name
         self.location_name = location_name
         self.gps_accuracy = gps_accuracy or 0
-
+        if battery:
+            self.battery = battery
         if attributes:
             self._attributes.update(attributes)
 
-- 
GitLab