HomeAssistant class
The main class for initializing and managing the Home Assistant connection.
Constructors
- HomeAssistant({required String baseUrl, required String bearerToken})
-
Creates an instance of HomeAssistant with the provided
baseUrl
andbearerToken
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
executeService(
String entityId, String action, {Map< String, dynamic> additionalActions = const {}}) → Future<bool> - Executes the provided action on the given Home Assistant Service.
-
fetchConfig(
) → Future< Configuration> - Fetches the Home Assistant configuration from the /api/config endpoint.
-
fetchServices(
) → Future< List< Service> > - Calls a service on Home Assistant.
-
fetchState(
String id) → Future< Entity> - Fetches a state object for one entity from Home Assistant.
-
fetchStates(
) → Future< List< Entity> > - Fetches a list of entities from Home Assistant.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyApiIsWorking(
) → Future< bool> -
Verifies the Home Assistant API is working on the provided
baseUrl
andbearerToken
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited