Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update poll control cluster #136

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ interface MeteringCluster extends ZCLNodeCluster {}

interface ElectricalMeasurementCluster extends ZCLNodeCluster {}

interface PollControlCluster extends ZCLNodeCluster {
fastPollStop(): Promise<void>;
setLongPollInterval(opts: { newLongPollInterval: number }): Promise<void>;
setShortPollInterval(opts: { newShortPollInterval: number }): Promise<void>;
}

type ZCLNodeEndpoint = {
clusters: {
onOff?: OnOffCluster;
Expand Down
29 changes: 26 additions & 3 deletions lib/clusters/pollControl.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
'use strict';

const { ZCLDataTypes } = require('../zclTypes');
const Cluster = require('../Cluster');

const ATTRIBUTES = {};

const COMMANDS = {};
const ATTRIBUTES = {
checkInInterval: { id: 0, type: ZCLDataTypes.uint32 },
longPollInterval: { id: 1, type: ZCLDataTypes.uint32 },
shortPollInterval: { id: 2, type: ZCLDataTypes.uint16 },
fastPollTimeout: { id: 3, type: ZCLDataTypes.uint16 },
checkInIntervalMin: { id: 4, type: ZCLDataTypes.uint32 },
longPollIntervalMin: { id: 5, type: ZCLDataTypes.uint32 },
fastPollTimeoutMax: { id: 6, type: ZCLDataTypes.uint16 },
};

const COMMANDS = {
fastPollStop: { id: 1 },
setLongPollInterval: {
id: 2,
args: {
newLongPollInterval: ZCLDataTypes.uint32,
},
},
setShortPollInterval: {
id: 3,
args: {
newShortPollInterval: ZCLDataTypes.uint16,
},
},
};

class PollControlCluster extends Cluster {

Expand Down
Loading