Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.tmb.sensor Namespace Reference

Classes

class  TMBSensor
 

Functions

None setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_BUS_STOP = "stop"
 
string ATTR_LINE = "line"
 
string CONF_APP_ID = "app_id"
 
string CONF_APP_KEY = "app_key"
 
string CONF_BUS_STOP = "stop"
 
string CONF_BUS_STOPS = "stops"
 
string CONF_LINE = "line"
 
 LINE_STOP_SCHEMA
 
 MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
 
 PLATFORM_SCHEMA
 

Detailed Description

Support for TMB (Transports Metropolitans de Barcelona) Barcelona public transport.

Function Documentation

◆ setup_platform()

None homeassistant.components.tmb.sensor.setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the sensors.

Definition at line 52 of file sensor.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.tmb.sensor._LOGGER = logging.getLogger(__name__)
private

Definition at line 23 of file sensor.py.

◆ ATTR_BUS_STOP

string homeassistant.components.tmb.sensor.ATTR_BUS_STOP = "stop"

Definition at line 30 of file sensor.py.

◆ ATTR_LINE

string homeassistant.components.tmb.sensor.ATTR_LINE = "line"

Definition at line 31 of file sensor.py.

◆ CONF_APP_ID

string homeassistant.components.tmb.sensor.CONF_APP_ID = "app_id"

Definition at line 25 of file sensor.py.

◆ CONF_APP_KEY

string homeassistant.components.tmb.sensor.CONF_APP_KEY = "app_key"

Definition at line 26 of file sensor.py.

◆ CONF_BUS_STOP

string homeassistant.components.tmb.sensor.CONF_BUS_STOP = "stop"

Definition at line 28 of file sensor.py.

◆ CONF_BUS_STOPS

string homeassistant.components.tmb.sensor.CONF_BUS_STOPS = "stops"

Definition at line 29 of file sensor.py.

◆ CONF_LINE

string homeassistant.components.tmb.sensor.CONF_LINE = "line"

Definition at line 27 of file sensor.py.

◆ LINE_STOP_SCHEMA

homeassistant.components.tmb.sensor.LINE_STOP_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_BUS_STOP): cv.string,
4  vol.Required(CONF_LINE): cv.string,
5  vol.Optional(CONF_NAME): cv.string,
6  }
7 )

Definition at line 35 of file sensor.py.

◆ MIN_TIME_BETWEEN_UPDATES

homeassistant.components.tmb.sensor.MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)

Definition at line 33 of file sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.tmb.sensor.PLATFORM_SCHEMA
Initial value:
1 = SENSOR_PLATFORM_SCHEMA.extend(
2  {
3  vol.Required(CONF_APP_ID): cv.string,
4  vol.Required(CONF_APP_KEY): cv.string,
5  vol.Required(CONF_BUS_STOPS): vol.All(cv.ensure_list, [LINE_STOP_SCHEMA]),
6  }
7 )

Definition at line 43 of file sensor.py.