HaApi class

Constructors

HaApi({required String url, required String token})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sl → ServiceLocator
final
url String
final

Methods

checkConfig() Future<(HaCheckConfig?, HaFailure?)>
Trigger a check of configuration.yaml.
getCalendar({required String entityId, required DateTime start, required DateTime end}) Future<(HaCalendar?, HaFailure?)>
Returns the list of calendar events for the specified calendar entity_id between the start and end times (exclusive).
getCalendars() Future<(HaCalendars?, HaFailure?)>
Returns the list of calendar entities.
getCameraProxy({required String entityId, required String time}) Future<(Uint8List?, HaFailure?)>
Returns the data (image) from the specified camera entity_id.
getConfig() Future<(HaConfig?, HaFailure?)>
Returns the current configuration as JSON.
getErrorLog() Future<(String?, HaFailure?)>
Retrieve all errors logged during the current session of Home Assistant as a plaintext response.
getEvents() Future<(HaEvents?, HaFailure?)>
Returns an array of event objects. Each event object contains event name and listener count.
getHistory({required String entityId, DateTime? startTime, DateTime? endTime}) Future<(List<HaState>?, HaFailure?)>
getLogbook({String? entityId, DateTime? startTime, DateTime? endTime}) Future<(HaLogbook?, HaFailure?)>
getServices() Future<(HaServices?, HaFailure?)>
Returns an array of service objects. Each object contains the domain and which services it contains.
getState({required String entityId}) Future<(HaState?, HaFailure?)>
Returns a state object for specified entity_id. Returns 404 if not found.
getStates() Future<(HaStates?, HaFailure?)>
Returns an array of state objects. Each state has the following attributes: entity_id, state, last_changed and attributes.
init() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping() Future<(HaMessage?, HaFailure?)>
Returns a message if the API is up and running.
postEvent({required String eventType, Map<String, dynamic>? eventData}) Future<(HaMessage?, HaFailure?)>
Fires an event with event_type.
postIntent({required String name, Map<String, dynamic>? variables}) Future<(String?, HaFailure?)>
Handle an intent.
postService({required String domain, required String service, Map<String, dynamic>? serviceData}) Future<(HaStates?, HaFailure?)>
Calls a service within a specific domain.
postState({required String entityId, required String state, Map<String, dynamic>? attributes}) Future<(HaState?, HaFailure?)>
Updates or creates a state. You can create any state that you want, it does not have to be backed by an entity in Home Assistant.
postTemplate({required String template, Map<String, dynamic>? variables}) Future<(String?, HaFailure?)>
Render a Home Assistant template.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited