1.0.53 • Published 1 year ago

lavva.exalushome.extalife-dev v1.0.53

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

ExalusHome ExtaLife library for Lavva

ExtaLife library is a part of exalushome-library that allows you to manage ExtraLife protocol devices connected to TR7 controller.

Library installation:

If you want to use this library in any JavaScript or TypeScript project you can use npm to install it as package from npm repository. For that you will have to use command:

npm install lavva.exalushome.extalife

or

yarn add lavva.exalushome.extalife

Initialization:

If you have installed this package then you have to initialize this library first before usage. To do this, you have to call:

import { ExtaLifeService } from 'lavva.exalushome.extalife/build/js/ExtaLife';
ExtaLifeService.Init();

Getting ExtaLifeService:

The library is based on the DI of exalushome-library, so you need to load the base service from the API, then you can load ExtaLife Device Services.

const extaLifeService = Api.Get<ExtaLifeService>(ExtaLifeService); 

Getting services of the device:

Getting device services is similar to getting any services from exalushome-library. To get any device service that is registered in dependency container you have to use Generic parameter of requested service and reference (name) of service that you want to use, some methods allow to load service for requested device so in this cases you need to put a device as reference.

To get any service that coud handle ExtaLife device functions You can use followed methods of ExtaLifeService:

Getting device service by type:

//Getting device service - general construction, in <IDeviceConfigService>(DeviceConfigService) we should put service that we want to load.
const deviceService = extaLifeService.GetDeviceServiceByServiceType<IDeviceConfigService>(DeviceConfigService)

//Getting device service - example of Rck21ConfigService 
const configService = extaLifeService.GetDeviceServiceByServiceType<IRck21ConfigService>(Rck21ConfigService)

Getting device service by IDevice reference:

//Getting IDevice by GUID (RCK-21)
const device = await devicesApi.GetDevice("bf5545ca-8bca-4364-a281-49676d307432")

//Getting configuration service by IDevice reference.
const configService = extaLifeService.GetDeviceService<IRck21ConfigService>(device, Rck21ConfigService);

A given device can support several services, we can get all supported services by method below using IDevice reference - functions returns array of supported services, if no service is supported then we get an empty array.

//Getting IDevice by GUID (RCK-21)
const device = await devicesApi.GetDevice("bf5545ca-8bca-4364-a281-49676d307432")

//Getting array of configuration services by IDevice reference.
const configServices = extaLifeService.GetAllDeviceServices(device);

We can check if given service is supported by any device:

//Getting IDevice by GUID (RCK-21)
const device = await devicesApi.GetDevice("bf5545ca-8bca-4364-a281-49676d307432")

//Checking if some service is supported, device and service reference as parameter.
const isSupportedRck21ConfigService = extaLifeService.IsDeviceServiceSupported(device, Rck21ConfigService)

Currently suported device services

  • IRck21ConfigService - configuration service for RCK-21 reed switch device

    Using device service

    Every device service have some unique methods to do some actions with ExtaLife device, method can change configs, get current settings of devices etc. Methods can take different parameters depending on the model of the device and functionality. Documentation for each service is available as a readme in the service catalogs: src/Devices/DeviceServices/service_name

    image

1.0.53

1 year ago

1.0.52

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.49

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago