Skip to content

OlivierZal/heatzy-api

Repository files navigation

Heatzy API for Node.js - v3.0.6

Enumerations

DerogMode

Enumeration Members

Enumeration Member Value Defined in
boost 2 src/enums.ts:11
off 0 src/enums.ts:12
vacation 1 src/enums.ts:13

Mode

Enumeration Members

Enumeration Member Value Defined in
cft 0 src/enums.ts:2
cft1 4 src/enums.ts:3
cft2 5 src/enums.ts:4
eco 1 src/enums.ts:5
fro 2 src/enums.ts:6
stop 3 src/enums.ts:7

Switch

Enumeration Members

Enumeration Member Value Defined in
off 0 src/enums.ts:17
on 1 src/enums.ts:18

Classes

DeviceFacade

Implements

Constructors

new DeviceFacade()
new DeviceFacade(manager: FacadeManager, instance: DeviceModel): DeviceFacade
Parameters
Parameter Type
manager FacadeManager
instance DeviceModel
Returns

DeviceFacade

Defined in

src/facades/device.ts:38

Properties

Property Modifier Type Defined in
api readonly HeatzyAPI src/facades/device.ts:28
id readonly string src/facades/device.ts:30
isFirstGen readonly boolean src/facades/device.ts:32
isFirstPilot readonly boolean src/facades/device.ts:34
isGlow readonly boolean src/facades/device.ts:36

Accessors

cftTempH
Get Signature
get cftTempH(): undefined | number
Returns

undefined | number

Implementation of

IDeviceFacade.cftTempH

Defined in

src/facades/device.ts:48

cftTempL
Get Signature
get cftTempL(): undefined | number
Returns

undefined | number

Implementation of

IDeviceFacade.cftTempL

Defined in

src/facades/device.ts:52

data
Get Signature
get data(): Attrs
Returns

Attrs

Implementation of

IDeviceFacade.data

Defined in

src/facades/device.ts:56

derogMode
Get Signature
get derogMode(): undefined | DerogMode
Returns

undefined | DerogMode

Implementation of

IDeviceFacade.derogMode

Defined in

src/facades/device.ts:60

derogSettings
Get Signature
get derogSettings(): undefined | DerogSettings
Returns

undefined | DerogSettings

Implementation of

IDeviceFacade.derogSettings

Defined in

src/facades/device.ts:64

derogTime
Get Signature
get derogTime(): undefined | number
Returns

undefined | number

Implementation of

IDeviceFacade.derogTime

Defined in

src/facades/device.ts:91

instance
Get Signature
get protected instance(): DeviceModel
Returns

DeviceModel

Defined in

src/facades/device.ts:114

lockSwitch
Get Signature
get lockSwitch(): undefined | Switch
Returns

undefined | Switch

Implementation of

IDeviceFacade.lockSwitch

Defined in

src/facades/device.ts:95

mode
Get Signature
get mode():
  | "cft"
  | "cft1"
  | "cft2"
  | "eco"
  | "fro"
  | "stop"
Returns

| "cft" | "cft1" | "cft2" | "eco" | "fro" | "stop"

Implementation of

IDeviceFacade.mode

Defined in

src/facades/device.ts:99

name
Get Signature
get name(): string
Returns

string

Implementation of

IDeviceFacade.name

Defined in

src/facades/device.ts:106

timerSwitch
Get Signature
get timerSwitch(): undefined | Switch
Returns

undefined | Switch

Implementation of

IDeviceFacade.timerSwitch

Defined in

src/facades/device.ts:110

Methods

get()
get(): Promise<Attrs>
Returns

Promise<Attrs>

Implementation of

IDeviceFacade.get

Defined in

src/facades/device.ts:124

set()
set(data: BaseAttrs): Promise<BaseAttrs>
Parameters
Parameter Type
data BaseAttrs
Returns

Promise<BaseAttrs>

Implementation of

IDeviceFacade.set

Defined in

src/facades/device.ts:130


DeviceModel

Implements

Properties

Property Modifier Type Defined in
id readonly string src/models/device.ts:10
isFirstGen public boolean src/models/device.ts:18
isFirstPilot public boolean src/models/device.ts:20
isGlow public boolean src/models/device.ts:22
name readonly string src/models/device.ts:12
productKey readonly string src/models/device.ts:14
productName readonly string src/models/device.ts:16

Accessors

data
Get Signature
get data(): Attrs
Returns

Attrs

Implementation of

IDeviceModel.data

Defined in

src/models/device.ts:39

Methods

update()
update(data: Partial<Attrs>): void
Parameters
Parameter Type
data Partial<Attrs>
Returns

void

Implementation of

IDeviceModel.update

Defined in

src/models/device.ts:64

getAll()
static getAll(): DeviceModel[]
Returns

DeviceModel[]

Defined in

src/models/device.ts:43

getById()
static getById(id: string): undefined | DeviceModel
Parameters
Parameter Type
id string
Returns

undefined | DeviceModel

Defined in

src/models/device.ts:47

getByName()
static getByName(name: string): undefined | DeviceModel
Parameters
Parameter Type
name string
Returns

undefined | DeviceModel

Defined in

src/models/device.ts:51

sync()
static sync(devices: readonly Device[], data: Record<string, Attrs>): void
Parameters
Parameter Type
devices readonly Device[]
data Record<string, Attrs>
Returns

void

Defined in

src/models/device.ts:55


FacadeManager

Constructors

new FacadeManager()
new FacadeManager(api: HeatzyAPI): FacadeManager
Parameters
Parameter Type
api HeatzyAPI
Returns

FacadeManager

Defined in

src/facades/manager.ts:11

Properties

Property Modifier Type Defined in
api readonly HeatzyAPI src/facades/manager.ts:7

Methods

get()
get()
get(): undefined
Returns

undefined

Defined in

src/facades/manager.ts:15

get(instance)
get(instance: DeviceModel): DeviceFacade
Parameters
Parameter Type
instance DeviceModel
Returns

DeviceFacade

Defined in

src/facades/manager.ts:16


HeatzyAPI

Implements

Constructors

new HeatzyAPI()
new HeatzyAPI(config: APIConfig): HeatzyAPI
Parameters
Parameter Type
config APIConfig
Returns

HeatzyAPI

Defined in

src/services/api.ts:54

Properties

Property Modifier Type Defined in
onSync? readonly () => Promise<void> src/services/api.ts:40
settingManager? readonly SettingManager src/services/api.ts:42

Methods

authenticate()
authenticate(data?: LoginPostData): Promise<boolean>
Parameters
Parameter Type
data? LoginPostData
Returns

Promise<boolean>

Implementation of

IAPI.authenticate

Defined in

src/services/api.ts:115

bindings()
bindings(): Promise<{
  data: Bindings;
}>
Returns

Promise<{ data: Bindings; }>

Name Type Defined in
data Bindings src/services/api.ts:129
Implementation of

IAPI.bindings

Defined in

src/services/api.ts:129

clearSync()
clearSync(): void
Returns

void

Implementation of

IAPI.clearSync

Defined in

src/services/api.ts:133

control()
control(__namedParameters: {
  id: string;
  postData: DevicePostDataAny;
 }): Promise<{
  data: Data;
}>
Parameters
Parameter Type
__namedParameters object
__namedParameters.id string
__namedParameters.postData DevicePostDataAny
Returns

Promise<{ data: Data; }>

Name Type Defined in
data Data src/services/api.ts:146
Implementation of

IAPI.control

Defined in

src/services/api.ts:140

deviceData()
deviceData(__namedParameters: {
  id: string;
 }): Promise<{
  data: DeviceData;
}>
Parameters
Parameter Type
__namedParameters object
__namedParameters.id string
Returns

Promise<{ data: DeviceData; }>

Name Type Defined in
data DeviceData src/services/api.ts:154
Implementation of

IAPI.deviceData

Defined in

src/services/api.ts:150

fetch()
fetch(): Promise<readonly Device[]>
Returns

Promise<readonly Device[]>

Implementation of

IAPI.fetch

Defined in

src/services/api.ts:100

login()
login(__namedParameters: {
  postData: LoginPostData;
 }): Promise<{
  data: LoginData;
}>
Parameters
Parameter Type
__namedParameters object
__namedParameters.postData LoginPostData
Returns

Promise<{ data: LoginData; }>

Name Type Defined in
data LoginData src/services/api.ts:162
Implementation of

IAPI.login

Defined in

src/services/api.ts:158

create()
static create(config: APIConfig): Promise<HeatzyAPI>
Parameters
Parameter Type
config APIConfig
Returns

Promise<HeatzyAPI>

Defined in

src/services/api.ts:93

Interfaces

APIConfig

Extends

Properties

Property Modifier Type Inherited from Defined in
autoSyncInterval? public null | number - src/services/interfaces.ts:39
language? public string - src/services/interfaces.ts:40
logger? public Logger - src/services/interfaces.ts:41
onSync? public () => Promise<void> - src/services/interfaces.ts:42
password? readonly string Partial.password src/types.ts:12
settingManager? public SettingManager - src/services/interfaces.ts:43
shouldVerifySSL? public boolean - src/services/interfaces.ts:44
timezone? public string - src/services/interfaces.ts:45
username? readonly string Partial.username src/types.ts:13

APISettings

Properties

Property Type Defined in
expireAt? null | string src/services/interfaces.ts:12
password? null | string src/services/interfaces.ts:13
token? null | string src/services/interfaces.ts:14
username? null | string src/services/interfaces.ts:15

BaseAttrs

Properties

Property Modifier Type Defined in
cft_tempH? readonly number src/types.ts:37
cft_tempL? readonly number src/types.ts:38
derog_mode? readonly DerogMode src/types.ts:39
derog_time? readonly number src/types.ts:40
lock_switch? readonly Switch src/types.ts:41
mode? readonly | Mode | "cft" | "cft1" | "cft2" | "eco" | "fro" | "stop" src/types.ts:42
timer_switch? readonly Switch src/types.ts:43

Bindings

Properties

Property Modifier Type Defined in
devices readonly readonly Device[] src/types.ts:29

DerogSettings

Properties

Property Type Defined in
derogEnd null | string src/facades/interfaces.ts:6
derogTimeBoost number src/facades/interfaces.ts:7
derogTimeVacation number src/facades/interfaces.ts:8

Device

Properties

Property Modifier Type Defined in
dev_alias readonly string src/types.ts:22
did readonly string src/types.ts:23
product_key readonly string src/types.ts:24
product_name readonly string src/types.ts:25

DeviceData

Properties

Property Modifier Type Defined in
attr readonly Attrs src/types.ts:56

DevicePostData

Properties

Property Modifier Type Defined in
attrs readonly BaseAttrs src/types.ts:47

ErrorData

Properties

Property Modifier Type Defined in
detail_message readonly null | string src/types.ts:7
error_message readonly null | string src/types.ts:8

FirstGenDevicePostData

Properties

Property Modifier Type Defined in
raw readonly [1, 1, Mode] src/types.ts:33

IAPI

Properties

Property Type Defined in
authenticate (data?: LoginPostData) => Promise<boolean> src/services/interfaces.ts:49
bindings () => Promise<{ data: Bindings; }> src/services/interfaces.ts:50
clearSync () => void src/services/interfaces.ts:51
control (__namedParameters: { id: string; postData: DevicePostDataAny; }) => Promise<{ data: Data; }> src/services/interfaces.ts:52
deviceData (__namedParameters: { id: string; }) => Promise<{ data: DeviceData; }> src/services/interfaces.ts:59
fetch () => Promise<readonly Device[]> src/services/interfaces.ts:60
login (__namedParameters: { postData: LoginPostData; }) => Promise<{ data: LoginData; }> src/services/interfaces.ts:61
onSync? () => Promise<void> src/services/interfaces.ts:66

IBaseDeviceModel

Extended by

Properties

Property Type Defined in
data Attrs src/models/interfaces.ts:4
id string src/models/interfaces.ts:5
isFirstGen boolean src/models/interfaces.ts:6
isFirstPilot boolean src/models/interfaces.ts:7
isGlow boolean src/models/interfaces.ts:8
name string src/models/interfaces.ts:9

IDeviceFacade

Extends

Properties

Property Type Inherited from Defined in
cftTempH? number - src/facades/interfaces.ts:15
cftTempL? number - src/facades/interfaces.ts:16
data Attrs IBaseDeviceModel.data src/models/interfaces.ts:4
derogMode? DerogMode - src/facades/interfaces.ts:17
derogSettings? DerogSettings - src/facades/interfaces.ts:18
derogTime? number - src/facades/interfaces.ts:19
get () => Promise<Attrs> - src/facades/interfaces.ts:12
id string IBaseDeviceModel.id src/models/interfaces.ts:5
isFirstGen boolean IBaseDeviceModel.isFirstGen src/models/interfaces.ts:6
isFirstPilot boolean IBaseDeviceModel.isFirstPilot src/models/interfaces.ts:7
isGlow boolean IBaseDeviceModel.isGlow src/models/interfaces.ts:8
lockSwitch? Switch - src/facades/interfaces.ts:20
mode | "cft" | "cft1" | "cft2" | "eco" | "fro" | "stop" - src/facades/interfaces.ts:13
name string IBaseDeviceModel.name src/models/interfaces.ts:9
set (data: BaseAttrs) => Promise<BaseAttrs> - src/facades/interfaces.ts:14
timerSwitch? Switch - src/facades/interfaces.ts:21

IDeviceModel

Extends

Properties

Property Type Inherited from Defined in
data Attrs IBaseDeviceModel.data src/models/interfaces.ts:4
id string IBaseDeviceModel.id src/models/interfaces.ts:5
isFirstGen boolean IBaseDeviceModel.isFirstGen src/models/interfaces.ts:6
isFirstPilot boolean IBaseDeviceModel.isFirstPilot src/models/interfaces.ts:7
isGlow boolean IBaseDeviceModel.isGlow src/models/interfaces.ts:8
name string IBaseDeviceModel.name src/models/interfaces.ts:9
productKey string - src/models/interfaces.ts:13
productName string - src/models/interfaces.ts:14
update (data: Attrs) => void - src/models/interfaces.ts:15

Logger

Properties

Property Type Defined in
error (message?: any, ...optionalParams: any[]) => void src/services/interfaces.ts:34
log (message?: any, ...optionalParams: any[]) => void src/services/interfaces.ts:35

LoginData

Properties

Property Modifier Type Defined in
expire_at readonly number src/types.ts:17
token readonly string src/types.ts:18

LoginPostData

Properties

Property Modifier Type Defined in
password readonly string src/types.ts:12
username readonly string src/types.ts:13

SettingManager

Properties

Property Type Defined in
get <K>(key: K) => APISettings[K] src/services/interfaces.ts:29
set <K>(key: K, value: APISettings[K]) => void src/services/interfaces.ts:30

Type Aliases

Attrs

type Attrs: Omit<BaseAttrs, "mode"> & {
  mode: keyof typeof Mode;
};

Type declaration

Name Type Defined in
mode keyof typeof Mode src/types.ts:53

Defined in

src/types.ts:52


Data

type Data: Record<string, never>;

Defined in

src/types.ts:4


DevicePostDataAny

type DevicePostDataAny: DevicePostData | FirstGenDevicePostData;

Defined in

src/types.ts:50

Variables

UNIT

const UNIT: 1 = 1

Defined in

src/constants.ts:1

Functions

syncDevices()

function syncDevices<T>(
  target: (...args: any[]) => Promise<T>,
  _context: ClassMethodDecoratorContext<
    unknown,
    (this: unknown, ...args: any) => any
  >,
): (...args: unknown[]) => Promise<T>

Type Parameters

Type Parameter
T extends readonly Device[] | BaseAttrs | Attrs

Parameters

Parameter Type
target (...args: any[]) => Promise<T>
_context ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>

Returns

Function

Parameters
Parameter Type
...args unknown[]
Returns

Promise<T>

Defined in

src/decorators/syncDevices.ts:5


updateDevice()

function updateDevice<T>(
  target: (...args: any[]) => Promise<T>,
  _context: ClassMethodDecoratorContext<
    unknown,
    (this: unknown, ...args: any) => any
  >,
): (...args: unknown[]) => Promise<T>

Type Parameters

Type Parameter
T extends BaseAttrs | Attrs

Parameters

Parameter Type
target (...args: any[]) => Promise<T>
_context ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>

Returns

Function

Parameters
Parameter Type
...args unknown[]
Returns

Promise<T>

Defined in

src/decorators/updateDevice.ts:11