Skip to content

OlivierZal/heatzy-api

Repository files navigation

Heatzy API for Node.js - v5.0.0

Enumerations

DerogationMode

Defined in: src/enums.ts:1

Enumeration Members

Enumeration Member Value Defined in
boost 2 src/enums.ts:2
off 0 src/enums.ts:3
presence 3 src/enums.ts:6
vacation 1 src/enums.ts:4

Mode

Defined in: src/enums.ts:9

Enumeration Members

Enumeration Member Value Defined in
cft "cft" src/enums.ts:10
cft1 "cft1" src/enums.ts:15
cft2 "cft2" src/enums.ts:16
eco "eco" src/enums.ts:11
fro "fro" src/enums.ts:12
stop "stop" src/enums.ts:13

ModeV1

Defined in: src/enums.ts:19

Enumeration Members

Enumeration Member Value Defined in
cft 0 src/enums.ts:20
eco 1 src/enums.ts:21
fro 2 src/enums.ts:22
stop 3 src/enums.ts:23

Product

Defined in: src/models/interfaces.ts:6

Enumeration Members

Enumeration Member Value Defined in
glow 5 src/models/interfaces.ts:7
pro 6 src/models/interfaces.ts:8
v1 1 src/models/interfaces.ts:9
v2 2 src/models/interfaces.ts:10
v4 4 src/models/interfaces.ts:11

Switch

Defined in: src/enums.ts:26

Enumeration Members

Enumeration Member Value Defined in
off 0 src/enums.ts:27
on 1 src/enums.ts:28

TemperatureCompensation

Defined in: src/enums.ts:31

Enumeration Members

Enumeration Member Value Defined in
minus5C 0 src/enums.ts:32
noChange 50 src/enums.ts:33
plus5C 100 src/enums.ts:34

Classes

DeviceModel

Defined in: src/models/device.ts:14

Implements

Properties

Property Modifier Type Defined in
id readonly string src/models/device.ts:17
name readonly string src/models/device.ts:19
product readonly Product src/models/device.ts:21
productKey readonly string src/models/device.ts:23
productName readonly string src/models/device.ts:25

Accessors

data
Get Signature
get data(): Attrs

Defined in: src/models/device.ts:44

Returns

Attrs

Implementation of

IDeviceModel.data

derogationEndDate
Get Signature
get derogationEndDate(): null | DateTime

Defined in: src/models/device.ts:48

Returns

null | DateTime

Implementation of

IDeviceModel.derogationEndDate

previousMode
Get Signature
get previousMode(): PreviousMode

Defined in: src/models/device.ts:54

Returns

PreviousMode

Implementation of

IDeviceModel.previousMode

Methods

update()
update(data: Partial<Attrs>): void

Defined in: src/models/device.ts:100

Parameters
Parameter Type
data Partial<Attrs>
Returns

void

Implementation of

IDeviceModel.update

getAll()
static getAll(): DeviceModel[]

Defined in: src/models/device.ts:58

Returns

DeviceModel[]

getById()
static getById(id: string): undefined | DeviceModel

Defined in: src/models/device.ts:62

Parameters
Parameter Type
id string
Returns

undefined | DeviceModel

getByName()
static getByName(name: string): undefined | DeviceModel

Defined in: src/models/device.ts:66

Parameters
Parameter Type
name string
Returns

undefined | DeviceModel

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

Defined in: src/models/device.ts:70

Parameters
Parameter Type
devices readonly Device[]
data Record<string, Attrs>
Returns

void


FacadeManager

Defined in: src/facades/manager.ts:12

Implements

Constructors

new FacadeManager()
new FacadeManager(api: IAPI): FacadeManager

Defined in: src/facades/manager.ts:17

Parameters
Parameter Type
api IAPI
Returns

FacadeManager

Properties

Property Modifier Type Defined in
api readonly IAPI src/facades/manager.ts:13

Methods

get()
Call Signature
get(): null

Defined in: src/facades/manager.ts:21

Returns

null

Implementation of

IFacadeManager.get

Call Signature
get(instance: IDeviceModel): IDeviceFacadeAny

Defined in: src/facades/manager.ts:22

Parameters
Parameter Type
instance IDeviceModel
Returns

IDeviceFacadeAny

Implementation of
IFacadeManager.get

HeatzyAPI

Defined in: src/services/api.ts:68

Implements

Constructors

new HeatzyAPI()
new HeatzyAPI(config: APIConfig): HeatzyAPI

Defined in: src/services/api.ts:83

Parameters
Parameter Type
config APIConfig
Returns

HeatzyAPI

Properties

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

Methods

authenticate()
authenticate(data?: LoginPostData): Promise<boolean>

Defined in: src/services/api.ts:144

Parameters
Parameter Type
data? LoginPostData
Returns

Promise<boolean>

Implementation of

IAPI.authenticate

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

Defined in: src/services/api.ts:158

Returns

Promise<{ data: Bindings; }>

Implementation of

IAPI.bindings

clearSync()
clearSync(): void

Defined in: src/services/api.ts:162

Returns

void

Implementation of

IAPI.clearSync

control()
control(__namedParameters: {
  id: string;
  postData: DevicePostDataAny;
 }): Promise<{
  data: Data;
}>

Defined in: src/services/api.ts:169

Parameters
Parameter Type
__namedParameters { id: string; postData: DevicePostDataAny; }
__namedParameters.id string
__namedParameters.postData DevicePostDataAny
Returns

Promise<{ data: Data; }>

Implementation of

IAPI.control

deviceData()
deviceData(__namedParameters: {
  id: string;
 }): Promise<{
  data: DeviceData;
}>

Defined in: src/services/api.ts:179

Parameters
Parameter Type
__namedParameters { id: string; }
__namedParameters.id string
Returns

Promise<{ data: DeviceData; }>

Implementation of

IAPI.deviceData

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

Defined in: src/services/api.ts:129

Returns

Promise<readonly Device[]>

Implementation of

IAPI.fetch

login()
login(__namedParameters: {
  postData: LoginPostData;
 }): Promise<{
  data: LoginData;
}>

Defined in: src/services/api.ts:187

Parameters
Parameter Type
__namedParameters { postData: LoginPostData; }
__namedParameters.postData LoginPostData
Returns

Promise<{ data: LoginData; }>

Implementation of

IAPI.login

create()
static create(config: APIConfig): Promise<HeatzyAPI>

Defined in: src/services/api.ts:122

Parameters
Parameter Type
config APIConfig
Returns

Promise<HeatzyAPI>

Interfaces

APIConfig

Defined in: src/services/interfaces.ts:11

Extends

Properties

Property Modifier Type Inherited from Defined in
autoSyncInterval? readonly null | number - src/services/interfaces.ts:12
language? readonly string - src/services/interfaces.ts:13
logger? readonly Logger - src/services/interfaces.ts:14
onSync? readonly OnSyncFunction - src/services/interfaces.ts:15
password? readonly string Partial.password src/types.ts:55
settingManager? readonly SettingManager - src/services/interfaces.ts:16
shouldVerifySSL? readonly boolean - src/services/interfaces.ts:17
timezone? readonly string - src/services/interfaces.ts:18
username? readonly string Partial.username src/types.ts:56

APISettings

Defined in: src/services/interfaces.ts:21

Properties

Property Modifier Type Defined in
expireAt? readonly null | string src/services/interfaces.ts:22
password? readonly null | string src/services/interfaces.ts:23
token? readonly null | string src/services/interfaces.ts:24
username? readonly null | string src/services/interfaces.ts:25

Attrs

Defined in: src/types.ts:10

Extends

Properties

Property Modifier Type Overrides Inherited from Defined in
cft_temp? readonly number - PostAttrs.cft_temp src/types.ts:77
cft_tempH? readonly number - PostAttrs.cft_tempH src/types.ts:70
cft_tempL? readonly number - PostAttrs.cft_tempL src/types.ts:71
com_temp? readonly TemperatureCompensation - PostAttrs.com_temp src/types.ts:68
cur_humi? readonly number - - src/types.ts:16
cur_mode? readonly Mode - - src/types.ts:17
cur_temp? readonly number - - src/types.ts:18
cur_tempH? readonly number - - src/types.ts:13
cur_tempL? readonly number - - src/types.ts:14
derog_mode? readonly DerogationMode - PostAttrs.derog_mode src/types.ts:62
derog_time? readonly number - PostAttrs.derog_time src/types.ts:63
eco_temp? readonly number - PostAttrs.eco_temp src/types.ts:78
eco_tempH? readonly number - PostAttrs.eco_tempH src/types.ts:72
eco_tempL? readonly number - PostAttrs.eco_tempL src/types.ts:73
lock_c? readonly Switch - PostAttrs.lock_c src/types.ts:74
lock_switch? readonly Switch - PostAttrs.lock_switch src/types.ts:66
mode readonly Mode PostAttrs.mode - src/types.ts:11
on_off? readonly Switch - PostAttrs.on_off src/types.ts:75
timer_switch? readonly Switch - PostAttrs.timer_switch src/types.ts:64
window_switch? readonly Switch - PostAttrs.window_switch src/types.ts:79

Bindings

Defined in: src/types.ts:21

Properties

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

Device

Defined in: src/types.ts:25

Properties

Property Modifier Type Defined in
dev_alias readonly string src/types.ts:26
did readonly string src/types.ts:27
product_key readonly string src/types.ts:28
product_name readonly string src/types.ts:29

DeviceData

Defined in: src/types.ts:32

Properties

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

DevicePostData

Defined in: src/types.ts:36

Properties

Property Modifier Type Defined in
attrs readonly PostAttrs src/types.ts:37

DeviceV1PostData

Defined in: src/types.ts:40

Properties

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

ErrorData

Defined in: src/types.ts:44

Properties

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

IAPI

Defined in: src/services/interfaces.ts:28

Properties

Property Modifier Type Defined in
authenticate readonly (data?: LoginPostData) => Promise<boolean> src/services/interfaces.ts:30
bindings readonly () => Promise<{ data: Bindings; }> src/services/interfaces.ts:31
clearSync readonly () => void src/services/interfaces.ts:32
control readonly (__namedParameters: { id: string; postData: DevicePostDataAny; }) => Promise<{ data: Data; }> src/services/interfaces.ts:33
deviceData readonly (__namedParameters: { id: string; }) => Promise<{ data: DeviceData; }> src/services/interfaces.ts:40
fetch readonly () => Promise<readonly Device[]> src/services/interfaces.ts:41
login readonly (__namedParameters: { postData: LoginPostData; }) => Promise<{ data: LoginData; }> src/services/interfaces.ts:42
onSync? readonly OnSyncFunction src/services/interfaces.ts:29

IDeviceFacade

Defined in: src/facades/interfaces.ts:12

Extends

  • IBaseDeviceModel

Extended by

Properties

Property Modifier Type Inherited from Defined in
derogationEndDate readonly null | DateTime IBaseDeviceModel.derogationEndDate src/models/interfaces.ts:15
id readonly string IBaseDeviceModel.id src/models/interfaces.ts:16
isOn readonly boolean - src/facades/interfaces.ts:13
mode readonly Mode - src/facades/interfaces.ts:14
name readonly string IBaseDeviceModel.name src/models/interfaces.ts:17
onSync readonly () => Promise<void> - src/facades/interfaces.ts:15
previousMode readonly PreviousMode IBaseDeviceModel.previousMode src/models/interfaces.ts:18
product readonly Product IBaseDeviceModel.product src/models/interfaces.ts:19
setValues readonly (data: PostAttrs) => Promise<Partial<Attrs>> - src/facades/interfaces.ts:16
update readonly (data: Partial<Attrs>) => void IBaseDeviceModel.update src/models/interfaces.ts:20
values readonly () => Promise<Attrs> - src/facades/interfaces.ts:17

IDeviceGlowFacade

Defined in: src/facades/interfaces.ts:20

Extends

Extended by

Properties

Property Modifier Type Inherited from Defined in
comfortTemperature readonly number - src/facades/interfaces.ts:21
currentTemperature readonly number - src/facades/interfaces.ts:22
derogationEndDate readonly null | DateTime IDeviceV2Facade.derogationEndDate src/facades/interfaces.ts:35
derogationEndString readonly null | string IDeviceV2Facade.derogationEndString src/facades/interfaces.ts:36
derogationMode readonly DerogationMode IDeviceV2Facade.derogationMode src/facades/interfaces.ts:37
derogationTime readonly number IDeviceV2Facade.derogationTime src/facades/interfaces.ts:38
ecoTemperature readonly number - src/facades/interfaces.ts:23
id readonly string IDeviceV2Facade.id src/models/interfaces.ts:16
isLocked readonly boolean IDeviceV2Facade.isLocked src/facades/interfaces.ts:39
isOn readonly boolean IDeviceV2Facade.isOn src/facades/interfaces.ts:13
isTimer readonly boolean IDeviceV2Facade.isTimer src/facades/interfaces.ts:40
mode readonly Mode IDeviceV2Facade.mode src/facades/interfaces.ts:14
name readonly string IDeviceV2Facade.name src/models/interfaces.ts:17
onSync readonly () => Promise<void> IDeviceV2Facade.onSync src/facades/interfaces.ts:15
previousMode readonly PreviousMode IDeviceV2Facade.previousMode src/models/interfaces.ts:18
product readonly Product IDeviceV2Facade.product src/models/interfaces.ts:19
setValues readonly (data: PostAttrs) => Promise<Partial<Attrs>> IDeviceV2Facade.setValues src/facades/interfaces.ts:16
temperatureCompensation readonly TemperatureCompensation - src/facades/interfaces.ts:24
update readonly (data: Partial<Attrs>) => void IDeviceV2Facade.update src/models/interfaces.ts:20
values readonly () => Promise<Attrs> IDeviceV2Facade.values src/facades/interfaces.ts:17

IDeviceModel

Defined in: src/models/interfaces.ts:23

Extends

  • IBaseDeviceModel

Properties

Property Modifier Type Inherited from Defined in
data readonly Attrs - src/models/interfaces.ts:24
derogationEndDate readonly null | DateTime IBaseDeviceModel.derogationEndDate src/models/interfaces.ts:15
id readonly string IBaseDeviceModel.id src/models/interfaces.ts:16
name readonly string IBaseDeviceModel.name src/models/interfaces.ts:17
previousMode readonly PreviousMode IBaseDeviceModel.previousMode src/models/interfaces.ts:18
product readonly Product IBaseDeviceModel.product src/models/interfaces.ts:19
productKey readonly string - src/models/interfaces.ts:25
productName readonly string - src/models/interfaces.ts:26
update readonly (data: Partial<Attrs>) => void IBaseDeviceModel.update src/models/interfaces.ts:20

IDeviceProFacade

Defined in: src/facades/interfaces.ts:27

Extends

Properties

Property Modifier Type Inherited from Defined in
comfortTemperature readonly number IDeviceGlowFacade.comfortTemperature src/facades/interfaces.ts:21
currentHumidity readonly number - src/facades/interfaces.ts:28
currentMode readonly Mode - src/facades/interfaces.ts:29
currentTemperature readonly number IDeviceGlowFacade.currentTemperature src/facades/interfaces.ts:22
derogationEndDate readonly null | DateTime IDeviceGlowFacade.derogationEndDate src/facades/interfaces.ts:35
derogationEndString readonly null | string IDeviceGlowFacade.derogationEndString src/facades/interfaces.ts:36
derogationMode readonly DerogationMode IDeviceGlowFacade.derogationMode src/facades/interfaces.ts:37
derogationTime readonly number IDeviceGlowFacade.derogationTime src/facades/interfaces.ts:38
ecoTemperature readonly number IDeviceGlowFacade.ecoTemperature src/facades/interfaces.ts:23
id readonly string IDeviceGlowFacade.id src/models/interfaces.ts:16
isDetectingOpenWindow readonly boolean - src/facades/interfaces.ts:30
isLocked readonly boolean IDeviceGlowFacade.isLocked src/facades/interfaces.ts:39
isOn readonly boolean IDeviceGlowFacade.isOn src/facades/interfaces.ts:13
isPresence readonly boolean - src/facades/interfaces.ts:31
isTimer readonly boolean IDeviceGlowFacade.isTimer src/facades/interfaces.ts:40
mode readonly Mode IDeviceGlowFacade.mode src/facades/interfaces.ts:14
name readonly string IDeviceGlowFacade.name src/models/interfaces.ts:17
onSync readonly () => Promise<void> IDeviceGlowFacade.onSync src/facades/interfaces.ts:15
previousMode readonly PreviousMode IDeviceGlowFacade.previousMode src/models/interfaces.ts:18
product readonly Product IDeviceGlowFacade.product src/models/interfaces.ts:19
setValues readonly (data: PostAttrs) => Promise<Partial<Attrs>> IDeviceGlowFacade.setValues src/facades/interfaces.ts:16
temperatureCompensation readonly TemperatureCompensation IDeviceGlowFacade.temperatureCompensation src/facades/interfaces.ts:24
update readonly (data: Partial<Attrs>) => void IDeviceGlowFacade.update src/models/interfaces.ts:20
values readonly () => Promise<Attrs> IDeviceGlowFacade.values src/facades/interfaces.ts:17

IDeviceV2Facade

Defined in: src/facades/interfaces.ts:34

Extends

Extended by

Properties

Property Modifier Type Overrides Inherited from Defined in
derogationEndDate readonly null | DateTime IDeviceFacade.derogationEndDate - src/facades/interfaces.ts:35
derogationEndString readonly null | string - - src/facades/interfaces.ts:36
derogationMode readonly DerogationMode - - src/facades/interfaces.ts:37
derogationTime readonly number - - src/facades/interfaces.ts:38
id readonly string - IDeviceFacade.id src/models/interfaces.ts:16
isLocked readonly boolean - - src/facades/interfaces.ts:39
isOn readonly boolean - IDeviceFacade.isOn src/facades/interfaces.ts:13
isTimer readonly boolean - - src/facades/interfaces.ts:40
mode readonly Mode - IDeviceFacade.mode src/facades/interfaces.ts:14
name readonly string - IDeviceFacade.name src/models/interfaces.ts:17
onSync readonly () => Promise<void> - IDeviceFacade.onSync src/facades/interfaces.ts:15
previousMode readonly PreviousMode - IDeviceFacade.previousMode src/models/interfaces.ts:18
product readonly Product - IDeviceFacade.product src/models/interfaces.ts:19
setValues readonly (data: PostAttrs) => Promise<Partial<Attrs>> - IDeviceFacade.setValues src/facades/interfaces.ts:16
update readonly (data: Partial<Attrs>) => void - IDeviceFacade.update src/models/interfaces.ts:20
values readonly () => Promise<Attrs> - IDeviceFacade.values src/facades/interfaces.ts:17

IFacadeManager

Defined in: src/facades/interfaces.ts:43

Properties

Property Modifier Type Defined in
get readonly (instance?: IDeviceModel) => null | IDeviceFacade src/facades/interfaces.ts:44

Logger

Defined in: src/services/interfaces.ts:49

Properties

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

LoginData

Defined in: src/types.ts:49

Properties

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

LoginPostData

Defined in: src/types.ts:54

Properties

Property Modifier Type Defined in
password readonly string src/types.ts:55
username readonly string src/types.ts:56

PostAttrs

Defined in: src/types.ts:59

Extended by

Properties

Property Modifier Type Defined in
cft_temp? readonly number src/types.ts:77
cft_tempH? readonly number src/types.ts:70
cft_tempL? readonly number src/types.ts:71
com_temp? readonly TemperatureCompensation src/types.ts:68
derog_mode? readonly DerogationMode src/types.ts:62
derog_time? readonly number src/types.ts:63
eco_temp? readonly number src/types.ts:78
eco_tempH? readonly number src/types.ts:72
eco_tempL? readonly number src/types.ts:73
lock_c? readonly Switch src/types.ts:74
lock_switch? readonly Switch src/types.ts:66
mode? readonly Mode src/types.ts:60
on_off? readonly Switch src/types.ts:75
timer_switch? readonly Switch src/types.ts:64
window_switch? readonly Switch src/types.ts:79

SettingManager

Defined in: src/services/interfaces.ts:54

Properties

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

Type Aliases

Data

type Data = Record<string, never>

Defined in: src/types.ts:82


DevicePostDataAny

type DevicePostDataAny = DevicePostData | DeviceV1PostData

Defined in: src/types.ts:84


IDeviceFacadeAny

type IDeviceFacadeAny =
  | IDeviceFacade
  | IDeviceGlowFacade
  | IDeviceProFacade
  | IDeviceV2Facade

Defined in: src/facades/interfaces.ts:47


OnSyncFunction()

type OnSyncFunction = (params?: { ids: string[] }) => Promise<void>

Defined in: src/services/interfaces.ts:62

Parameters

Parameter Type
params? { ids: string[]; }
params.ids? string[]

Returns

Promise<void>


PreviousMode

type PreviousMode = Exclude<Mode, stop>

Defined in: src/models/interfaces.ts:29

Variables

UNIT

const UNIT: 1 = 1

Defined in: src/constants.ts:3

Functions

getTargetTemperature()

function getTargetTemperature(
  product: Product,
  mode: cft | eco,
  value: number,
): PostAttrs

Defined in: src/utils.ts:14

Parameters

Parameter Type
product Product
mode cft | eco
value number

Returns

PostAttrs


supportsGlow()

function supportsGlow(device: IDeviceFacadeAny): device is IDeviceGlowFacade

Defined in: src/facades/interfaces.ts:57

Parameters

Parameter Type
device IDeviceFacadeAny

Returns

device is IDeviceGlowFacade


supportsPro()

function supportsPro(device: IDeviceFacadeAny): device is IDeviceProFacade

Defined in: src/facades/interfaces.ts:61

Parameters

Parameter Type
device IDeviceFacadeAny

Returns

device is IDeviceProFacade


supportsV2()

function supportsV2(device: IDeviceFacadeAny): device is IDeviceV2Facade

Defined in: src/facades/interfaces.ts:53

Parameters

Parameter Type
device IDeviceFacadeAny

Returns

device is IDeviceV2Facade


syncDevices()

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

Defined in: src/decorators/sync-devices.ts:5

Type Parameters

Type Parameter
T extends | readonly Device[] | Partial<Attrs>

Parameters

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

Returns

Function

Parameters
Parameter Type
...args unknown[]
Returns

Promise<T>


updateDevice()

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

Defined in: src/decorators/update-device.ts:4

Type Parameters

Type Parameter
T extends Partial<Attrs>

Parameters

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

Returns

Function

Parameters
Parameter Type
...args unknown[]
Returns

Promise<T>

About

Heatzy API for Node.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •