Skip to main content
Glama
Tommertom

Plugwise MCP Server

by Tommertom
location-parser.ts1.22 kB
/** * Location Parser * Parses location (zone/room) data into GatewayEntity */ import { GatewayEntity } from '../../types/plugwise-types.js'; import { MeasurementParser } from './measurement-parser.js'; export class LocationParser { private measurementParser: MeasurementParser; constructor() { this.measurementParser = new MeasurementParser(); } /** * Parse location data into GatewayEntity */ parseLocation(location: any): GatewayEntity | null { try { const entity: GatewayEntity = { name: location.name || 'Unknown Location', dev_class: 'zone', available: true, sensors: {}, binary_sensors: {}, switches: {} }; // Parse preset and schedule information if (location.preset) { entity.active_preset = location.preset; } // Parse measurements from logs this.measurementParser.parseMeasurements(location, entity); return entity; } catch (error) { console.error('Failed to parse location:', 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