From e077998d38e2bca07c112fa9d45909fd1cc3961e Mon Sep 17 00:00:00 2001 From: lrmate Date: Sat, 1 Jul 2017 08:32:10 +0200 Subject: [PATCH] Update modbus.py (#8256) * Update modbus.py Prevents Modbus binary sensors showing up as "unnamed_device". Originally proposed here https://community.home-assistant.io/t/modbus-sensor/6751/11 by user Pjeter * Update modbus.py --- homeassistant/components/binary_sensor/modbus.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/binary_sensor/modbus.py b/homeassistant/components/binary_sensor/modbus.py index 54e4cefb230..3a9b57ba6de 100644 --- a/homeassistant/components/binary_sensor/modbus.py +++ b/homeassistant/components/binary_sensor/modbus.py @@ -50,6 +50,10 @@ class ModbusCoilSensor(BinarySensorDevice): self._coil = int(coil) self._value = None + def name(self): + """Return the name of the sensor.""" + return self._name + @property def is_on(self): """Return the state of the sensor."""