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

Classes

class  DublinPublicTransportSensor
 
class  PublicTransportData
 

Functions

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

Variables

string _RESOURCE = "https://data.dublinked.ie/cgi-bin/rtpi/realtimebusinformation"
 
string ATTR_DUE_AT = "Due at"
 
string ATTR_DUE_IN = "Due in"
 
string ATTR_NEXT_UP = "Later Bus"
 
string ATTR_ROUTE = "Route"
 
string ATTR_STOP_ID = "Stop ID"
 
string CONF_ROUTE = "route"
 
string CONF_STOP_ID = "stopid"
 
string DEFAULT_NAME = "Next Bus"
 
 PLATFORM_SCHEMA
 
 SCAN_INTERVAL = timedelta(minutes=1)
 
string TIME_STR_FORMAT = "%H:%M"
 

Detailed Description

Support for Dublin RTPI information from data.dublinked.ie.

For more info on the API see :
https://data.gov.ie/dataset/real-time-passenger-information-rtpi-for-dublin-bus-bus-eireann-luas-and-irish-rail/resource/4b9f2c4f-6bf5-4958-a43a-f12dab04cf61

Function Documentation

◆ due_in_minutes()

def homeassistant.components.dublin_bus_transport.sensor.due_in_minutes (   timestamp)
Get the time in minutes from a timestamp.

The timestamp should be in the format day/month/year hour/minute/second

Definition at line 54 of file sensor.py.

◆ setup_platform()

None homeassistant.components.dublin_bus_transport.sensor.setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the Dublin public transport sensor.

Definition at line 66 of file sensor.py.

Variable Documentation

◆ _RESOURCE

string homeassistant.components.dublin_bus_transport.sensor._RESOURCE = "https://data.dublinked.ie/cgi-bin/rtpi/realtimebusinformation"
private

Definition at line 28 of file sensor.py.

◆ ATTR_DUE_AT

string homeassistant.components.dublin_bus_transport.sensor.ATTR_DUE_AT = "Due at"

Definition at line 33 of file sensor.py.

◆ ATTR_DUE_IN

string homeassistant.components.dublin_bus_transport.sensor.ATTR_DUE_IN = "Due in"

Definition at line 32 of file sensor.py.

◆ ATTR_NEXT_UP

string homeassistant.components.dublin_bus_transport.sensor.ATTR_NEXT_UP = "Later Bus"

Definition at line 34 of file sensor.py.

◆ ATTR_ROUTE

string homeassistant.components.dublin_bus_transport.sensor.ATTR_ROUTE = "Route"

Definition at line 31 of file sensor.py.

◆ ATTR_STOP_ID

string homeassistant.components.dublin_bus_transport.sensor.ATTR_STOP_ID = "Stop ID"

Definition at line 30 of file sensor.py.

◆ CONF_ROUTE

string homeassistant.components.dublin_bus_transport.sensor.CONF_ROUTE = "route"

Definition at line 37 of file sensor.py.

◆ CONF_STOP_ID

string homeassistant.components.dublin_bus_transport.sensor.CONF_STOP_ID = "stopid"

Definition at line 36 of file sensor.py.

◆ DEFAULT_NAME

string homeassistant.components.dublin_bus_transport.sensor.DEFAULT_NAME = "Next Bus"

Definition at line 39 of file sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.dublin_bus_transport.sensor.PLATFORM_SCHEMA
Initial value:
1 = SENSOR_PLATFORM_SCHEMA.extend(
2  {
3  vol.Required(CONF_STOP_ID): cv.string,
4  vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
5  vol.Optional(CONF_ROUTE, default=""): cv.string,
6  }
7 )

Definition at line 45 of file sensor.py.

◆ SCAN_INTERVAL

homeassistant.components.dublin_bus_transport.sensor.SCAN_INTERVAL = timedelta(minutes=1)

Definition at line 42 of file sensor.py.

◆ TIME_STR_FORMAT

string homeassistant.components.dublin_bus_transport.sensor.TIME_STR_FORMAT = "%H:%M"

Definition at line 43 of file sensor.py.