Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.nextbus.util Namespace Reference

Classes

class  RouteStop
 

Functions

list[Any] listify (Any maybe_list)
 
Any maybe_first (list[Any]|None maybe_list)
 

Detailed Description

Utils for NextBus integration module.

Function Documentation

◆ listify()

list[Any] homeassistant.components.nextbus.util.listify ( Any  maybe_list)
Return list version of whatever value is passed in.

This is used to provide a consistent way of interacting with the JSON
results from the API. There are several attributes that will either missing
if there are no values, a single dictionary if there is only one value, and
a list if there are multiple.

Definition at line 6 of file util.py.

◆ maybe_first()

Any homeassistant.components.nextbus.util.maybe_first ( list[Any] | None  maybe_list)
Return the first item out of a list or returns back the input.

Definition at line 21 of file util.py.