diff --git a/homeassistant/components/nest/__init__.py b/homeassistant/components/nest/__init__.py index 57111350396..f609c774b12 100644 --- a/homeassistant/components/nest/__init__.py +++ b/homeassistant/components/nest/__init__.py @@ -309,6 +309,37 @@ class NestSensorDevice(Entity): """Do not need poll thanks using Nest streaming API.""" return False + @property + def unique_id(self): + """Return unique id based on device serial and variable.""" + return "{}-{}".format(self.device.serial, self.variable) + + @property + def device_info(self): + """Return information about the device.""" + if not hasattr(self.device, 'name_long'): + name = self.structure.name + model = "Structure" + else: + name = self.device.name_long + if self.device.is_thermostat: + model = 'Thermostat' + elif self.device.is_camera: + model = 'Camera' + elif self.device.is_smoke_co_alarm: + model = 'Nest Protect' + else: + model = None + + return { + 'identifiers': { + (DOMAIN, self.device.serial) + }, + 'name': name, + 'manufacturer': 'Nest Labs', + 'model': model, + } + def update(self): """Do not use NestSensorDevice directly.""" raise NotImplementedError