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
This commit is contained in:
lrmate 2017-07-01 08:32:10 +02:00 committed by Paulus Schoutsen
parent 7123ec14be
commit e077998d38

View File

@ -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."""