import { Subject } from 'rxjs/Subject'; import { Observable } from 'rxjs/Observable'; import { Model } from '../common/model'; import { DeviceModel } from '../models/device.model'; import { LocationModel } from '../models/location.model'; import { SmartenitTranslationService } from '../common/translation/smartenit-translation.service'; import { TemperatureConverterService } from '../common/temperature-converter.service'; import { IWebSocketDeviceMessage } from '../websockets/websocket-device-message.interface'; import { ISmartenitPluginMessage } from './smartenit-plugin-message.interface'; import { DatabaseService } from '../storage/database.service'; import { DevicesService } from '../resources/devices.service'; import { ActionsService } from '../resources/actions.service'; import { ConditionsService } from '../resources/conditions.service'; import { EffectsService } from '../resources/effects.service'; import { MetricsService } from '../resources/metrics.service'; import { PluginUtilsService } from './plugin-utils.service'; export declare abstract class SmartenitPlugin { dbService: DatabaseService; devicesService: DevicesService; actionsService: ActionsService; conditionsService: ConditionsService; effectsService: EffectsService; pluginUtilsService: PluginUtilsService; metricsService: MetricsService; translationService: SmartenitTranslationService; temperatureConverterService: TemperatureConverterService; private _name; private _resource; private _componentId; private _processorName; private _state; private _stateTTL; private _customOptions; stateTTL: number; readonly name: string; readonly device: DeviceModel; readonly location: LocationModel; readonly componentId: string; readonly processorName: string; customOptions: any; protected onCustomOptionsChanged(): void; state: any; saveState(state: any, ttl?: number, timestamp?: number): void; private _onData; readonly onData: Observable; protected _onUpdate: Subject; readonly onUpdate: Observable; private resourceIsDevice(); private resourceIsLocation(); getStatus(context?: string, force?: boolean, subscribe?: boolean, payload?: any, sendDirect?: boolean): void; getStatusPayload(): any; getReportableAttrs(): any; getCachedValues(subscribe?: boolean): any; private parseCachePath(path); constructor(name: string, componentId: string, processorName: string, resource: Model, dbService: DatabaseService, devicesService: DevicesService, actionsService: ActionsService, conditionsService: ConditionsService, effectsService: EffectsService, pluginUtilsService: PluginUtilsService, metricsService: MetricsService, translationService: SmartenitTranslationService, temperatureConverterService: TemperatureConverterService); protected abstract processMessage(data: IWebSocketDeviceMessage, timestamp?: number): any; protected processDeviceMessage(data: IWebSocketDeviceMessage, timestamp?: number): any; getRawValue(value: any, attribute?: string, method?: string): any; getProcessedValue(value: any, attribute?: string, method?: string): any; /** * Executed when the plugin has loaded cache information if available */ onInit(): void; getCacheKey(category?: string): string; setCache(category: string, data: any, ttl?: number, subscribe?: boolean, timestamp?: number): any; getCache(category?: string): Observable; getReadAttributeDelay(): number | undefined; executeMethod(componentId: string, processorName: string, method: string, payload: any, requestStatus?: boolean, payloadStatus?: any, query?: string): void; setAttributeWithSubscribeOption(componentId: string, processorName: string, attribute: string, payload: any, subscribe: boolean, readAttribute?: boolean): Observable | undefined; getAttributeWithSubscribeOption(componentId: string, processorName: string, attribute: string, payload: any, subscribe: boolean, query?: string): Observable | undefined; getValueDescription(value: any): string; }