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

Classes

class  VasttrafikDepartureSensor
 

Functions

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

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_ACCESSIBILITY = "accessibility"
 
string ATTR_DELAY = "delay"
 
string ATTR_DIRECTION = "direction"
 
string ATTR_FROM = "from"
 
string ATTR_LINE = "line"
 
string ATTR_TO = "to"
 
string ATTR_TRACK = "track"
 
string CONF_DEPARTURES = "departures"
 
string CONF_FROM = "from"
 
string CONF_HEADING = "heading"
 
string CONF_KEY = "key"
 
string CONF_LINES = "lines"
 
string CONF_SECRET = "secret"
 
int DEFAULT_DELAY = 0
 
 MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120)
 
 PLATFORM_SCHEMA
 

Detailed Description

Support for Västtrafik public transport.

Function Documentation

◆ setup_platform()

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

Definition at line 63 of file sensor.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 23 of file sensor.py.

◆ ATTR_ACCESSIBILITY

string homeassistant.components.vasttrafik.sensor.ATTR_ACCESSIBILITY = "accessibility"

Definition at line 25 of file sensor.py.

◆ ATTR_DELAY

string homeassistant.components.vasttrafik.sensor.ATTR_DELAY = "delay"

Definition at line 31 of file sensor.py.

◆ ATTR_DIRECTION

string homeassistant.components.vasttrafik.sensor.ATTR_DIRECTION = "direction"

Definition at line 26 of file sensor.py.

◆ ATTR_FROM

string homeassistant.components.vasttrafik.sensor.ATTR_FROM = "from"

Definition at line 29 of file sensor.py.

◆ ATTR_LINE

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

Definition at line 27 of file sensor.py.

◆ ATTR_TO

string homeassistant.components.vasttrafik.sensor.ATTR_TO = "to"

Definition at line 30 of file sensor.py.

◆ ATTR_TRACK

string homeassistant.components.vasttrafik.sensor.ATTR_TRACK = "track"

Definition at line 28 of file sensor.py.

◆ CONF_DEPARTURES

string homeassistant.components.vasttrafik.sensor.CONF_DEPARTURES = "departures"

Definition at line 33 of file sensor.py.

◆ CONF_FROM

string homeassistant.components.vasttrafik.sensor.CONF_FROM = "from"

Definition at line 34 of file sensor.py.

◆ CONF_HEADING

string homeassistant.components.vasttrafik.sensor.CONF_HEADING = "heading"

Definition at line 35 of file sensor.py.

◆ CONF_KEY

string homeassistant.components.vasttrafik.sensor.CONF_KEY = "key"

Definition at line 37 of file sensor.py.

◆ CONF_LINES

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

Definition at line 36 of file sensor.py.

◆ CONF_SECRET

string homeassistant.components.vasttrafik.sensor.CONF_SECRET = "secret"

Definition at line 38 of file sensor.py.

◆ DEFAULT_DELAY

int homeassistant.components.vasttrafik.sensor.DEFAULT_DELAY = 0

Definition at line 40 of file sensor.py.

◆ MIN_TIME_BETWEEN_UPDATES

homeassistant.components.vasttrafik.sensor.MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120)

Definition at line 42 of file sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.vasttrafik.sensor.PLATFORM_SCHEMA
Initial value:
1 = SENSOR_PLATFORM_SCHEMA.extend(
2  {
3  vol.Required(CONF_KEY): cv.string,
4  vol.Required(CONF_SECRET): cv.string,
5  vol.Required(CONF_DEPARTURES): [
6  {
7  vol.Required(CONF_FROM): cv.string,
8  vol.Optional(CONF_DELAY, default=DEFAULT_DELAY): cv.positive_int,
9  vol.Optional(CONF_HEADING): cv.string,
10  vol.Optional(CONF_LINES, default=[]): vol.All(
11  cv.ensure_list, [cv.string]
12  ),
13  vol.Optional(CONF_NAME): cv.string,
14  }
15  ],
16  }
17 )

Definition at line 44 of file sensor.py.