Skip to content

germanozambelli/hassio-apiclient-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

$ composer require germanozambelli/hassio-apiclient-php

Api Client Configuration

use GermanoZambelli\Hassio\Credentials\ApiCredentials;
use GermanoZambelli\Hassio\Hassio;

$apiCredentials = new ApiCredentials('http://ipaddress:port', 'password');
$hassio = new Hassio($apiCredentials);

Methods available for ApiCredentials

getConfig(): SimpleResponse

return the current hassio configuration

validationConfigFiles(): ValidationConfigResponse

return the validity of the hassio configuration files

callService(string $domain, string $service, array $data): SimpleResponse

call an hassio service

turnOnEntity(Entity $entity): SimpleResponse

turn on an entity

turnOffEntity(Entity $entity): SimpleResponse

turn off an entity

getEntitiesState(): EntitiesStateResponse

return list of all entities

Configurator Client Configuration

to use it you need to install HASS CONFIGURATOR on hassio

use GermanoZambelli\Hassio\Credentials\ConfiguratorCredentials;
use GermanoZambelli\Hassio\Hassio;

$configuratorCredentials = new ConfiguratorCredentials('http://ipaddress:port', 'username', 'password');
$hassio = new Hassio(null, $configuratorCredentials);

Methods available for ConfiguratorCredentials

getConfigFile(string $fileName): SimpleResponse

return a configuration file

saveConfigFile(string $fileName, string $content): SaveConfigFileResponse

overwrite a configuration file

About

A simple client for hass.io API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages