Download the PHP package indexzer0/ha-rest-api-client without Composer
On this page you can find all versions of the php package indexzer0/ha-rest-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download indexzer0/ha-rest-api-client
More information about indexzer0/ha-rest-api-client
Files in indexzer0/ha-rest-api-client
Package ha-rest-api-client
Short Description Simple client for accessing home assistant rest api.
License MIT
Homepage https://github.com/indexzer0/ha-rest-api-client
Informations about the package ha-rest-api-client
ha-rest-api-client
Clients for accessing HomeAssistant Rest API & Webhooks.
- Requirements
- Installation
- Prerequisites
- Usage
- Basic (Http Client Auto Discovery)
- Custom Http Client (optional)
- HaRestApiClient - Available Methods
- HaWebhookClient - Available Methods
- Error Handling
- Changelog
- Contributing
Requirements
- PHP Version >= 8.2
- A PSR-18 compatible http client.
- A PSR-17 compatible factory.
Installation
You can install the package via composer:
This library does not have a dependency on Guzzle or any other library that sends HTTP requests. This packages uses the awesome HTTPlug to achieve the decoupling. We want you to choose what library to use for sending HTTP requests. Consult this list of packages that support php-http/client-implementation to find clients to use. For more information about virtual packages please refer to HTTPlug.
Install your choice of http client.
Example:
Prerequisites
- Check out the Home Assistant Rest Api docs.
- Add the API integration to your
configuration.yaml
. - Create a
Long-Lived Access Token
in your profile.
- Add the API integration to your
Usage
This package provides two clients. HaRestApiClient
and HaWebhookClient
.
Basic (Http Client Auto Discovery)
Custom Http Client (optional)
The client needs to know what library you are using to send HTTP messages. You could provide an instance of a PSR-18 compatible http client and PSR-17 compatible factory, or you could fallback on auto discovery (basic example above). Below is an example on where you provide a Guzzle7 instance.
HaRestApiClient - Available Methods
HaWebhookClient - Available Methods
Error Handling
All exceptions thrown by the package implement \IndexZer0\HaRestApiClient\Exception\HaExceptionInterface
.
How-ever it doesn't harm to also catch \Throwable
.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
- Currently accepting PR for as I don't have a camera entity to develop against.
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of ha-rest-api-client with dependencies
php-http/client-common Version ^2.4
php-http/discovery Version ^1.19
php-http/httplug Version ^2.4