UNPKG

zigbee-herdsman-converters

Version:

Collection of device converters to be used with zigbee-herdsman

204 lines • 7.65 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.definitions = void 0; const m = __importStar(require("../lib/modernExtend")); const reporting = __importStar(require("../lib/reporting")); exports.definitions = [ { zigbeeModel: ["Bed.box"], model: "Bed.box", vendor: "Sprut.device", description: "Sprut bed.box ergomotion controller", extend: [ m.deviceEndpoints({ endpoints: { light: 1, head_control: 2, foot_control: 3, head_massage_intensity: 4, foot_massage_intensity: 5, massage_duration: 6, flat: 7, zero_gravity: 8, reading: 9, tv: 10, head_feedback: 11, foot_feedback: 12, clear_angles_settings: 16, massage: 21, anti_snoring: 24, move: 26, stop: 27, }, }), m.numeric({ name: "head_position", endpointNames: ["head_control"], cluster: "genMultistateInput", attribute: "presentValue", description: "Head position (0-100%)", valueMin: 0, valueMax: 100, unit: "%", reporting: { min: 1, max: 100, change: 1, }, }), m.numeric({ name: "foot_position", endpointNames: ["foot_control"], cluster: "genMultistateInput", attribute: "presentValue", description: "Foot position (0-100%)", valueMin: 0, valueMax: 100, unit: "%", reporting: { min: 1, max: 100, change: 1, }, }), m.numeric({ name: "current_head_position", endpointNames: ["head_feedback"], cluster: "genMultistateOutput", attribute: "presentValue", description: "Current head position", access: "STATE_GET", unit: "%", }), m.numeric({ name: "current_foot_position", endpointNames: ["foot_feedback"], cluster: "genMultistateOutput", attribute: "presentValue", description: "Current foot position", access: "STATE_GET", unit: "%", }), m.enumLookup({ name: "head_massage_intensity", endpointName: "head_massage_intensity", cluster: "genMultistateInput", attribute: "presentValue", description: "Head massage intensity (0-6)", lookup: { off: 0, one: 1, two: 2, three: 3, four: 4, five: 5 }, }), m.enumLookup({ name: "foot_massage_intensity", endpointName: "foot_massage_intensity", cluster: "genMultistateInput", attribute: "presentValue", description: "Foot massage intensity (0-6)", lookup: { off: 0, one: 1, two: 2, three: 3, four: 4, five: 5 }, }), m.enumLookup({ name: "massage_duration", endpointName: "massage_duration", cluster: "genMultistateInput", attribute: "presentValue", description: "Massage duration (0=off, 1=10min, 2=20min, 3=30min)", lookup: { off: 0, ten_min: 1, twenty_min: 2, thirty_min: 3 }, }), m.onOff({ powerOnBehavior: false, endpointNames: ["light"], description: "Backlight", }), m.onOff({ powerOnBehavior: false, endpointNames: ["flat"], description: "Flat mode", }), m.onOff({ powerOnBehavior: false, endpointNames: ["zero_gravity"], description: "Zero gravity mode", }), m.onOff({ powerOnBehavior: false, endpointNames: ["reading"], description: "Reading mode", }), m.onOff({ powerOnBehavior: false, endpointNames: ["tv"], description: "TV mode", }), m.onOff({ powerOnBehavior: false, endpointNames: ["clear_angles_settings"], description: "Clear angle settings", }), m.onOff({ powerOnBehavior: false, endpointNames: ["massage"], description: "Massage", }), m.onOff({ powerOnBehavior: false, endpointNames: ["anti_snoring"], description: "Anti snoring mode", }), m.onOff({ powerOnBehavior: false, endpointNames: ["move"], description: "Move", }), m.onOff({ powerOnBehavior: false, endpointNames: ["stop"], description: "Stop", }), ], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ["genBasic", "genOnOff"]); for (const ep of device.endpoints) { if ([2, 3, 4, 5, 6].includes(ep.ID)) { await reporting.bind(ep, coordinatorEndpoint, ["genMultistateInput"]); } if ([11, 12].includes(ep.ID)) { await reporting.bind(ep, coordinatorEndpoint, ["genMultistateOutput"]); } } }, }, ]; //# sourceMappingURL=sprut.js.map