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

Classes

class  NSDepartureSensor
 

Functions

None setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)
 
def valid_stations (stations, given_stations)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string CONF_FROM = "from"
 
string CONF_ROUTES = "routes"
 
string CONF_TIME = "time"
 
string CONF_TO = "to"
 
string CONF_VIA = "via"
 
 MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120)
 
 PLATFORM_SCHEMA
 
 ROUTE_SCHEMA
 
 ROUTES_SCHEMA = vol.All(cv.ensure_list, [ROUTE_SCHEMA])
 

Detailed Description

Support for Nederlandse Spoorwegen public transport.

Function Documentation

◆ setup_platform()

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

Definition at line 53 of file sensor.py.

◆ valid_stations()

def homeassistant.components.nederlandse_spoorwegen.sensor.valid_stations (   stations,
  given_stations 
)
Verify the existence of the given station codes.

Definition at line 95 of file sensor.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 25 of file sensor.py.

◆ CONF_FROM

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

Definition at line 28 of file sensor.py.

◆ CONF_ROUTES

string homeassistant.components.nederlandse_spoorwegen.sensor.CONF_ROUTES = "routes"

Definition at line 27 of file sensor.py.

◆ CONF_TIME

string homeassistant.components.nederlandse_spoorwegen.sensor.CONF_TIME = "time"

Definition at line 31 of file sensor.py.

◆ CONF_TO

string homeassistant.components.nederlandse_spoorwegen.sensor.CONF_TO = "to"

Definition at line 29 of file sensor.py.

◆ CONF_VIA

string homeassistant.components.nederlandse_spoorwegen.sensor.CONF_VIA = "via"

Definition at line 30 of file sensor.py.

◆ MIN_TIME_BETWEEN_UPDATES

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

Definition at line 34 of file sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.nederlandse_spoorwegen.sensor.PLATFORM_SCHEMA
Initial value:
1 = SENSOR_PLATFORM_SCHEMA.extend(
2  {vol.Required(CONF_API_KEY): cv.string, vol.Optional(CONF_ROUTES): ROUTES_SCHEMA}
3 )

Definition at line 48 of file sensor.py.

◆ ROUTE_SCHEMA

homeassistant.components.nederlandse_spoorwegen.sensor.ROUTE_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_NAME): cv.string,
4  vol.Required(CONF_FROM): cv.string,
5  vol.Required(CONF_TO): cv.string,
6  vol.Optional(CONF_VIA): cv.string,
7  vol.Optional(CONF_TIME): cv.time,
8  }
9 )

Definition at line 36 of file sensor.py.

◆ ROUTES_SCHEMA

homeassistant.components.nederlandse_spoorwegen.sensor.ROUTES_SCHEMA = vol.All(cv.ensure_list, [ROUTE_SCHEMA])

Definition at line 46 of file sensor.py.