mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Add tcp component.
This commit is contained in:
20
homeassistant/components/sensor/tcp.py
Normal file
20
homeassistant/components/sensor/tcp.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
homeassistant.components.sensor.tcp
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Provides a sensor which gets its values from a TCP socket.
|
||||
"""
|
||||
import logging
|
||||
|
||||
from homeassistant.components import tcp
|
||||
|
||||
|
||||
DEPENDENCIES = [tcp.DOMAIN]
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
""" Create the Sensor. """
|
||||
if not tcp.TCPEntity.validate_config(config):
|
||||
return False
|
||||
add_entities((tcp.TCPEntity(config),))
|
||||
Reference in New Issue
Block a user