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

Classes

class  MVGLiveData
 
class  MVGLiveSensor
 

Functions

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

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTRIBUTION = "Data provided by MVG-live.de"
 
string CONF_DESTINATIONS = "destinations"
 
string CONF_DIRECTIONS = "directions"
 
string CONF_LINES = "lines"
 
string CONF_NEXT_DEPARTURE = "nextdeparture"
 
string CONF_NUMBER = "number"
 
string CONF_PRODUCTS = "products"
 
string CONF_STATION = "station"
 
string CONF_TIMEOFFSET = "timeoffset"
 
list DEFAULT_PRODUCT = ["U-Bahn", "Tram", "Bus", "ExpressBus", "S-Bahn", "Nachteule"]
 
dictionary ICONS
 
 PLATFORM_SCHEMA
 
 SCAN_INTERVAL = timedelta(seconds=30)
 

Detailed Description

Support for departure information for public transport in Munich.

Function Documentation

◆ setup_platform()

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

Definition at line 71 of file sensor.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 23 of file sensor.py.

◆ ATTRIBUTION

string homeassistant.components.mvglive.sensor.ATTRIBUTION = "Data provided by MVG-live.de"

Definition at line 47 of file sensor.py.

◆ CONF_DESTINATIONS

string homeassistant.components.mvglive.sensor.CONF_DESTINATIONS = "destinations"

Definition at line 28 of file sensor.py.

◆ CONF_DIRECTIONS

string homeassistant.components.mvglive.sensor.CONF_DIRECTIONS = "directions"

Definition at line 29 of file sensor.py.

◆ CONF_LINES

string homeassistant.components.mvglive.sensor.CONF_LINES = "lines"

Definition at line 30 of file sensor.py.

◆ CONF_NEXT_DEPARTURE

string homeassistant.components.mvglive.sensor.CONF_NEXT_DEPARTURE = "nextdeparture"

Definition at line 25 of file sensor.py.

◆ CONF_NUMBER

string homeassistant.components.mvglive.sensor.CONF_NUMBER = "number"

Definition at line 33 of file sensor.py.

◆ CONF_PRODUCTS

string homeassistant.components.mvglive.sensor.CONF_PRODUCTS = "products"

Definition at line 31 of file sensor.py.

◆ CONF_STATION

string homeassistant.components.mvglive.sensor.CONF_STATION = "station"

Definition at line 27 of file sensor.py.

◆ CONF_TIMEOFFSET

string homeassistant.components.mvglive.sensor.CONF_TIMEOFFSET = "timeoffset"

Definition at line 32 of file sensor.py.

◆ DEFAULT_PRODUCT

list homeassistant.components.mvglive.sensor.DEFAULT_PRODUCT = ["U-Bahn", "Tram", "Bus", "ExpressBus", "S-Bahn", "Nachteule"]

Definition at line 35 of file sensor.py.

◆ ICONS

dictionary homeassistant.components.mvglive.sensor.ICONS
Initial value:
1 = {
2  "U-Bahn": "mdi:subway",
3  "Tram": "mdi:tram",
4  "Bus": "mdi:bus",
5  "ExpressBus": "mdi:bus",
6  "S-Bahn": "mdi:train",
7  "Nachteule": "mdi:owl",
8  "SEV": "mdi:checkbox-blank-circle-outline",
9  "-": "mdi:clock",
10 }

Definition at line 37 of file sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.mvglive.sensor.PLATFORM_SCHEMA
Initial value:
1 = SENSOR_PLATFORM_SCHEMA.extend(
2  {
3  vol.Required(CONF_NEXT_DEPARTURE): [
4  {
5  vol.Required(CONF_STATION): cv.string,
6  vol.Optional(CONF_DESTINATIONS, default=[""]): cv.ensure_list_csv,
7  vol.Optional(CONF_DIRECTIONS, default=[""]): cv.ensure_list_csv,
8  vol.Optional(CONF_LINES, default=[""]): cv.ensure_list_csv,
9  vol.Optional(
10  CONF_PRODUCTS, default=DEFAULT_PRODUCT
11  ): cv.ensure_list_csv,
12  vol.Optional(CONF_TIMEOFFSET, default=0): cv.positive_int,
13  vol.Optional(CONF_NUMBER, default=1): cv.positive_int,
14  vol.Optional(CONF_NAME): cv.string,
15  }
16  ]
17  }
18 )

Definition at line 51 of file sensor.py.

◆ SCAN_INTERVAL

homeassistant.components.mvglive.sensor.SCAN_INTERVAL = timedelta(seconds=30)

Definition at line 49 of file sensor.py.