Tenth MyTotalComfort - TenthPres/MyTotalComfort GitHub Wiki
Tenth\MyTotalComfort
Class MyTotalComfort
The Scope of one object of this class is defined as the bounds of what can be seen by a single user using the TCC web interface.
- Class name: MyTotalComfort
- Namespace: Tenth
Properties
$cookieJar
protected \GuzzleHttp\Cookie\CookieJarInterface $cookieJar = null
- Visibility: protected
$client
protected \GuzzleHttp\Client $client = null
- Visibility: protected
$defaultLocationId
protected integer $defaultLocationId = null
- Visibility: protected
$locations
protected array<mixed,\Tenth\MyTotalComfort\Location> $locations = array()
- Visibility: protected
$zones
protected array<mixed,\Tenth\MyTotalComfort\Zone> $zones = array()
- Visibility: protected
private string $email
- Visibility: private
$password
private string $password
- Visibility: private
$tzUTC
public mixed $tzUTC = null
- Visibility: public
- This property is static.
Methods
__construct
void Tenth\MyTotalComfort::__construct(string $email, string $password, \GuzzleHttp\Cookie\CookieJarInterface $cookieJar)
MyTotalComfort constructor. Pass login arguments.
- Visibility: public
Arguments
- $email string - Login email address.
- $password string - Login password.
- $cookieJar GuzzleHttp\Cookie\CookieJarInterface - Optional. Cookie jar to be used if desired. Useful for allowing TCC logins to persist between script runs. If not provided, one will be created.
request
\Psr\Http\Message\ResponseInterface Tenth\MyTotalComfort::request(string $method, string $uri, array<mixed,mixed> $options, integer $recurr)
Wrapper for the Guzzle request method. Detects when the client is not logged in, and executes the login.
- Visibility: public
Arguments
- $method string - 'POST', 'GET', etc.
- $uri string - The URI to which the request is to be sent.
- $options array<mixed,mixed> - Guzzle Client options.
- $recurr integer - The number of recursions executed. Times out after 2.
Returns
- \Psr\Http\Message\ResponseInterface -
getLocations
array<mixed,\Tenth\MyTotalComfort\Location> Tenth\MyTotalComfort::getLocations(boolean $reload)
Gets the list of locations available in the current context.
- Visibility: public
Arguments
- $reload boolean - When true, sends a request (or multiple requests) to the server. Otherwise, simply returns the list stored in the cache.
Returns
- array<mixed,\Tenth\MyTotalComfort\Location> -
getLocation
\Tenth\MyTotalComfort\Location Tenth\MyTotalComfort::getLocation(integer|null $id, array<mixed,mixed> $dataFromCaller)
Gets a particular location within the user context.
- Visibility: public
Arguments
- $id integer|null - The ID number of the location desired, or null for the default location.
- $dataFromCaller array<mixed,mixed> - Data to be included in the Location gleaned from the caller.
Returns
- \Tenth\MyTotalComfort\Location -
getZone
\Tenth\MyTotalComfort\Zone Tenth\MyTotalComfort::getZone(integer $id, array<mixed,mixed> $dataFromCaller)
Gets a particular zone within the user context.
- Visibility: public
Arguments
- $id integer - The ID number of the zone desired. Required.
- $dataFromCaller array<mixed,mixed> - Data to be included in the Zone gleaned from the caller.
Returns
- \Tenth\MyTotalComfort\Zone -
getZonesByLocation
array<mixed,\Tenth\MyTotalComfort\Zone> Tenth\MyTotalComfort::getZonesByLocation(integer|\Tenth\MyTotalComfort\Location $location, boolean $reload)
Gets all of the zones in a single location.
- Visibility: public
Arguments
- $location integer|integer - A Location object or the id of a location. Uses first location if null.
- $reload boolean - When true, the list is loaded fresh from the server.
Returns
- array<mixed,\Tenth\MyTotalComfort\Zone> -
login
false|\Psr\Http\Message\ResponseInterface Tenth\MyTotalComfort::login(integer $recurr)
The login function. Wraps the client's request to https://www.mytotalconnectcomfort.com/portal/?timeout=True
- Visibility: protected
Arguments
- $recurr integer - Increments from 0 during recursion.
Returns
- false|\Psr\Http\Message\ResponseInterface - Whether login was accepted. Read the error with the $loginError property.
loadZonesInLocation
array<mixed,\Tenth\MyTotalComfort\Zone> Tenth\MyTotalComfort::loadZonesInLocation(integer $locationId)
- Visibility: protected
Arguments
- $locationId integer
Returns
- array<mixed,\Tenth\MyTotalComfort\Zone> -
addZonesFromHtml
array<mixed,\Tenth\MyTotalComfort\Zone> Tenth\MyTotalComfort::addZonesFromHtml(string $html, integer $pageNumber, integer $locationId)
- Visibility: protected
Arguments
- $html string* $pageNumber integer* $locationId integer
Returns
- array<mixed,\Tenth\MyTotalComfort\Zone> -