Skip to content

OlivierZal/heatzy-api

Repository files navigation

Heatzy API for Node.js - v4.15.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:28

Extends

Properties

Property Modifier Type Inherited from Defined in
autoSyncInterval? public null | number - src/services/interfaces.ts:29
language? public string - src/services/interfaces.ts:30
logger? public Logger - src/services/interfaces.ts:31
onSync? public OnSyncFunction - src/services/interfaces.ts:32
password? readonly string Partial.password src/types.ts:55
settingManager? public SettingManager - src/services/interfaces.ts:33
shouldVerifySSL? public boolean - src/services/interfaces.ts:34
timezone? public string - src/services/interfaces.ts:35
username? readonly string Partial.username src/types.ts:56

APISettings

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

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

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:38

Properties

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

IDeviceFacade

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

Extends

  • IBaseDeviceModel

Extended by

Properties

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

IDeviceGlowFacade

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

Extends

Extended by

Properties

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

IDeviceModel

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

Extends

  • IBaseDeviceModel

Properties

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

IDeviceProFacade

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

Extends

Properties

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

IDeviceV2Facade

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

Extends

Extended by

Properties

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

IFacadeManager

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

Properties

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

Logger

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

Properties

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

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:64

Properties

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

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:69

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,
  temperature: 'cft_temp' | 'eco_temp',
  value: number,
): PostAttrs

Defined in: src/utils.ts:8

Parameters

Parameter Type
product Product
temperature "cft_temp" | "eco_temp"
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

  •  
  •  
  •  
  •