Skip to main content
Glama
Tommertom

Plugwise MCP Server

by Tommertom
appliance-parser.ts1.68 kB
/** * Appliance Parser * Parses appliance (device) data into GatewayEntity */ import { GatewayEntity } from '../../types/plugwise-types.js'; import { MeasurementParser } from './measurement-parser.js'; import { ActuatorParser } from './actuator-parser.js'; export class ApplianceParser { private measurementParser: MeasurementParser; private actuatorParser: ActuatorParser; constructor() { this.measurementParser = new MeasurementParser(); this.actuatorParser = new ActuatorParser(); } /** * Parse appliance data into GatewayEntity */ parseAppliance(appliance: any): GatewayEntity | null { try { const entity: GatewayEntity = { name: appliance.name || 'Unknown Device', dev_class: appliance.type || 'unknown', model: appliance.vendor_model || undefined, vendor: appliance.vendor_name || undefined, firmware: appliance.firmware_version || undefined, hardware: appliance.hardware_version || undefined, mac_address: appliance.mac_address || undefined, available: true, sensors: {}, binary_sensors: {}, switches: {} }; // Parse measurements (sensors) this.measurementParser.parseMeasurements(appliance, entity); // Parse actuators (switches, thermostats) this.actuatorParser.parseActuators(appliance, entity); return entity; } catch (error) { console.error('Failed to parse appliance:', error); return null; } } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tommertom/plugwise-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server