npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lavva.exalushome.extalife

v2.0.107

Published

Library implementing communication and abstraction layers for ExtaLife API in ExalusHome system

Downloads

411

Readme

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  = await extaLifeService.GetDeviceServiceByServiceTypeAsync<IDeviceConfigService>(DeviceConfigService)

//Getting device service - example of Rck21ConfigService 
const configService = await extaLifeService.GetDeviceServiceByServiceTypeAsync<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 = await extaLifeService.GetDeviceServiceAsync<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 = await extaLifeService.GetAllDeviceServicesAsync(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