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

Classes

class  GTFSDepartureSensor
 

Functions

dict get_next_departure (Any schedule, Any start_station_id, Any end_station_id, datetime.timedelta offset, bool include_tomorrow=False)
 
None setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_ARRIVAL = "arrival"
 
string ATTR_BICYCLE = "trip_bikes_allowed_state"
 
string ATTR_DAY = "day"
 
string ATTR_DROP_OFF_DESTINATION = "destination_stop_drop_off_type_state"
 
string ATTR_DROP_OFF_ORIGIN = "origin_stop_drop_off_type_state"
 
string ATTR_FIRST = "first"
 
string ATTR_INFO = "info"
 
string ATTR_LAST = "last"
 
string ATTR_LOCATION_DESTINATION = "destination_station_location_type_name"
 
string ATTR_LOCATION_ORIGIN = "origin_station_location_type_name"
 
 ATTR_OFFSET = CONF_OFFSET
 
string ATTR_PICKUP_DESTINATION = "destination_stop_pickup_type_state"
 
string ATTR_PICKUP_ORIGIN = "origin_stop_pickup_type_state"
 
string ATTR_ROUTE_TYPE = "route_type_name"
 
string ATTR_TIMEPOINT_DESTINATION = "destination_stop_timepoint_exact"
 
string ATTR_TIMEPOINT_ORIGIN = "origin_stop_timepoint_exact"
 
string ATTR_WHEELCHAIR = "trip_wheelchair_access_available"
 
string ATTR_WHEELCHAIR_DESTINATION = "destination_station_wheelchair_boarding_available"
 
string ATTR_WHEELCHAIR_ORIGIN = "origin_station_wheelchair_boarding_available"
 
 BICYCLE_ALLOWED_DEFAULT = STATE_UNKNOWN
 
dictionary BICYCLE_ALLOWED_OPTIONS = {1: True, 2: False}
 
string CONF_DATA = "data"
 
string CONF_DESTINATION = "destination"
 
string CONF_ORIGIN = "origin"
 
string CONF_TOMORROW = "include_tomorrow"
 
string DEFAULT_NAME = "GTFS Sensor"
 
string DEFAULT_PATH = "gtfs"
 
 DROP_OFF_TYPE_DEFAULT = STATE_UNKNOWN
 
dictionary DROP_OFF_TYPE_OPTIONS
 
string ICON = "mdi:train"
 
dictionary ICONS
 
string LOCATION_TYPE_DEFAULT = "Stop"
 
dictionary LOCATION_TYPE_OPTIONS
 
 PICKUP_TYPE_DEFAULT = STATE_UNKNOWN
 
dictionary PICKUP_TYPE_OPTIONS
 
 PLATFORM_SCHEMA
 
dictionary ROUTE_TYPE_OPTIONS
 
bool TIMEPOINT_DEFAULT = True
 
dictionary TIMEPOINT_OPTIONS = {0: False, 1: True}
 
 WHEELCHAIR_ACCESS_DEFAULT = STATE_UNKNOWN
 
dictionary WHEELCHAIR_ACCESS_OPTIONS = {1: True, 2: False}
 
 WHEELCHAIR_BOARDING_DEFAULT = STATE_UNKNOWN
 
dictionary WHEELCHAIR_BOARDING_OPTIONS = {1: True, 2: False}
 

Detailed Description

Support for GTFS (Google/General Transport Format Schema).

Function Documentation

◆ get_next_departure()

dict homeassistant.components.gtfs.sensor.get_next_departure ( Any  schedule,
Any  start_station_id,
Any  end_station_id,
datetime.timedelta  offset,
bool   include_tomorrow = False 
)
Get the next departure for the given schedule.

Definition at line 269 of file sensor.py.

◆ setup_platform()

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

Definition at line 482 of file sensor.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 28 of file sensor.py.

◆ ATTR_ARRIVAL

string homeassistant.components.gtfs.sensor.ATTR_ARRIVAL = "arrival"

Definition at line 30 of file sensor.py.

◆ ATTR_BICYCLE

string homeassistant.components.gtfs.sensor.ATTR_BICYCLE = "trip_bikes_allowed_state"

Definition at line 31 of file sensor.py.

◆ ATTR_DAY

string homeassistant.components.gtfs.sensor.ATTR_DAY = "day"

Definition at line 32 of file sensor.py.

◆ ATTR_DROP_OFF_DESTINATION

string homeassistant.components.gtfs.sensor.ATTR_DROP_OFF_DESTINATION = "destination_stop_drop_off_type_state"

Definition at line 34 of file sensor.py.

◆ ATTR_DROP_OFF_ORIGIN

string homeassistant.components.gtfs.sensor.ATTR_DROP_OFF_ORIGIN = "origin_stop_drop_off_type_state"

Definition at line 35 of file sensor.py.

◆ ATTR_FIRST

string homeassistant.components.gtfs.sensor.ATTR_FIRST = "first"

Definition at line 33 of file sensor.py.

◆ ATTR_INFO

string homeassistant.components.gtfs.sensor.ATTR_INFO = "info"

Definition at line 36 of file sensor.py.

◆ ATTR_LAST

string homeassistant.components.gtfs.sensor.ATTR_LAST = "last"

Definition at line 38 of file sensor.py.

◆ ATTR_LOCATION_DESTINATION

string homeassistant.components.gtfs.sensor.ATTR_LOCATION_DESTINATION = "destination_station_location_type_name"

Definition at line 39 of file sensor.py.

◆ ATTR_LOCATION_ORIGIN

string homeassistant.components.gtfs.sensor.ATTR_LOCATION_ORIGIN = "origin_station_location_type_name"

Definition at line 40 of file sensor.py.

◆ ATTR_OFFSET

homeassistant.components.gtfs.sensor.ATTR_OFFSET = CONF_OFFSET

Definition at line 37 of file sensor.py.

◆ ATTR_PICKUP_DESTINATION

string homeassistant.components.gtfs.sensor.ATTR_PICKUP_DESTINATION = "destination_stop_pickup_type_state"

Definition at line 41 of file sensor.py.

◆ ATTR_PICKUP_ORIGIN

string homeassistant.components.gtfs.sensor.ATTR_PICKUP_ORIGIN = "origin_stop_pickup_type_state"

Definition at line 42 of file sensor.py.

◆ ATTR_ROUTE_TYPE

string homeassistant.components.gtfs.sensor.ATTR_ROUTE_TYPE = "route_type_name"

Definition at line 43 of file sensor.py.

◆ ATTR_TIMEPOINT_DESTINATION

string homeassistant.components.gtfs.sensor.ATTR_TIMEPOINT_DESTINATION = "destination_stop_timepoint_exact"

Definition at line 44 of file sensor.py.

◆ ATTR_TIMEPOINT_ORIGIN

string homeassistant.components.gtfs.sensor.ATTR_TIMEPOINT_ORIGIN = "origin_stop_timepoint_exact"

Definition at line 45 of file sensor.py.

◆ ATTR_WHEELCHAIR

string homeassistant.components.gtfs.sensor.ATTR_WHEELCHAIR = "trip_wheelchair_access_available"

Definition at line 46 of file sensor.py.

◆ ATTR_WHEELCHAIR_DESTINATION

string homeassistant.components.gtfs.sensor.ATTR_WHEELCHAIR_DESTINATION = "destination_station_wheelchair_boarding_available"

Definition at line 47 of file sensor.py.

◆ ATTR_WHEELCHAIR_ORIGIN

string homeassistant.components.gtfs.sensor.ATTR_WHEELCHAIR_ORIGIN = "origin_station_wheelchair_boarding_available"

Definition at line 48 of file sensor.py.

◆ BICYCLE_ALLOWED_DEFAULT

homeassistant.components.gtfs.sensor.BICYCLE_ALLOWED_DEFAULT = STATE_UNKNOWN

Definition at line 58 of file sensor.py.

◆ BICYCLE_ALLOWED_OPTIONS

dictionary homeassistant.components.gtfs.sensor.BICYCLE_ALLOWED_OPTIONS = {1: True, 2: False}

Definition at line 59 of file sensor.py.

◆ CONF_DATA

string homeassistant.components.gtfs.sensor.CONF_DATA = "data"

Definition at line 50 of file sensor.py.

◆ CONF_DESTINATION

string homeassistant.components.gtfs.sensor.CONF_DESTINATION = "destination"

Definition at line 51 of file sensor.py.

◆ CONF_ORIGIN

string homeassistant.components.gtfs.sensor.CONF_ORIGIN = "origin"

Definition at line 52 of file sensor.py.

◆ CONF_TOMORROW

string homeassistant.components.gtfs.sensor.CONF_TOMORROW = "include_tomorrow"

Definition at line 53 of file sensor.py.

◆ DEFAULT_NAME

string homeassistant.components.gtfs.sensor.DEFAULT_NAME = "GTFS Sensor"

Definition at line 55 of file sensor.py.

◆ DEFAULT_PATH

string homeassistant.components.gtfs.sensor.DEFAULT_PATH = "gtfs"

Definition at line 56 of file sensor.py.

◆ DROP_OFF_TYPE_DEFAULT

homeassistant.components.gtfs.sensor.DROP_OFF_TYPE_DEFAULT = STATE_UNKNOWN

Definition at line 60 of file sensor.py.

◆ DROP_OFF_TYPE_OPTIONS

dictionary homeassistant.components.gtfs.sensor.DROP_OFF_TYPE_OPTIONS
Initial value:
1 = {
2  0: "Regular",
3  1: "Not Available",
4  2: "Call Agency",
5  3: "Contact Driver",
6 }

Definition at line 61 of file sensor.py.

◆ ICON

string homeassistant.components.gtfs.sensor.ICON = "mdi:train"

Definition at line 67 of file sensor.py.

◆ ICONS

dictionary homeassistant.components.gtfs.sensor.ICONS

Definition at line 68 of file sensor.py.

◆ LOCATION_TYPE_DEFAULT

string homeassistant.components.gtfs.sensor.LOCATION_TYPE_DEFAULT = "Stop"

Definition at line 152 of file sensor.py.

◆ LOCATION_TYPE_OPTIONS

dictionary homeassistant.components.gtfs.sensor.LOCATION_TYPE_OPTIONS
Initial value:
1 = {
2  0: "Station",
3  1: "Stop",
4  2: "Station Entrance/Exit",
5  3: "Other",
6 }

Definition at line 153 of file sensor.py.

◆ PICKUP_TYPE_DEFAULT

homeassistant.components.gtfs.sensor.PICKUP_TYPE_DEFAULT = STATE_UNKNOWN

Definition at line 159 of file sensor.py.

◆ PICKUP_TYPE_OPTIONS

dictionary homeassistant.components.gtfs.sensor.PICKUP_TYPE_OPTIONS
Initial value:
1 = {
2  0: "Regular",
3  1: "None Available",
4  2: "Call Agency",
5  3: "Contact Driver",
6 }

Definition at line 160 of file sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.gtfs.sensor.PLATFORM_SCHEMA
Initial value:
1 = SENSOR_PLATFORM_SCHEMA.extend(
2  {
3  vol.Required(CONF_ORIGIN): cv.string,
4  vol.Required(CONF_DESTINATION): cv.string,
5  vol.Required(CONF_DATA): cv.string,
6  vol.Optional(CONF_NAME): cv.string,
7  vol.Optional(CONF_OFFSET, default=0): cv.time_period,
8  vol.Optional(CONF_TOMORROW, default=False): cv.boolean,
9  }
10 )

Definition at line 257 of file sensor.py.

◆ ROUTE_TYPE_OPTIONS

dictionary homeassistant.components.gtfs.sensor.ROUTE_TYPE_OPTIONS

Definition at line 166 of file sensor.py.

◆ TIMEPOINT_DEFAULT

bool homeassistant.components.gtfs.sensor.TIMEPOINT_DEFAULT = True

Definition at line 250 of file sensor.py.

◆ TIMEPOINT_OPTIONS

dictionary homeassistant.components.gtfs.sensor.TIMEPOINT_OPTIONS = {0: False, 1: True}

Definition at line 251 of file sensor.py.

◆ WHEELCHAIR_ACCESS_DEFAULT

homeassistant.components.gtfs.sensor.WHEELCHAIR_ACCESS_DEFAULT = STATE_UNKNOWN

Definition at line 252 of file sensor.py.

◆ WHEELCHAIR_ACCESS_OPTIONS

dictionary homeassistant.components.gtfs.sensor.WHEELCHAIR_ACCESS_OPTIONS = {1: True, 2: False}

Definition at line 253 of file sensor.py.

◆ WHEELCHAIR_BOARDING_DEFAULT

homeassistant.components.gtfs.sensor.WHEELCHAIR_BOARDING_DEFAULT = STATE_UNKNOWN

Definition at line 254 of file sensor.py.

◆ WHEELCHAIR_BOARDING_OPTIONS

dictionary homeassistant.components.gtfs.sensor.WHEELCHAIR_BOARDING_OPTIONS = {1: True, 2: False}

Definition at line 255 of file sensor.py.