meross-iot 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/LICENSE +21 -0
- package/README.md +153 -0
- package/index.d.ts +2344 -0
- package/index.js +131 -0
- package/lib/controller/device.js +1317 -0
- package/lib/controller/features/alarm-feature.js +89 -0
- package/lib/controller/features/child-lock-feature.js +61 -0
- package/lib/controller/features/config-feature.js +54 -0
- package/lib/controller/features/consumption-feature.js +210 -0
- package/lib/controller/features/control-feature.js +62 -0
- package/lib/controller/features/diffuser-feature.js +411 -0
- package/lib/controller/features/digest-timer-feature.js +22 -0
- package/lib/controller/features/digest-trigger-feature.js +22 -0
- package/lib/controller/features/dnd-feature.js +79 -0
- package/lib/controller/features/electricity-feature.js +144 -0
- package/lib/controller/features/encryption-feature.js +259 -0
- package/lib/controller/features/garage-feature.js +337 -0
- package/lib/controller/features/hub-feature.js +687 -0
- package/lib/controller/features/light-feature.js +408 -0
- package/lib/controller/features/presence-sensor-feature.js +297 -0
- package/lib/controller/features/roller-shutter-feature.js +456 -0
- package/lib/controller/features/runtime-feature.js +74 -0
- package/lib/controller/features/screen-feature.js +67 -0
- package/lib/controller/features/sensor-history-feature.js +47 -0
- package/lib/controller/features/smoke-config-feature.js +50 -0
- package/lib/controller/features/spray-feature.js +166 -0
- package/lib/controller/features/system-feature.js +269 -0
- package/lib/controller/features/temp-unit-feature.js +55 -0
- package/lib/controller/features/thermostat-feature.js +804 -0
- package/lib/controller/features/timer-feature.js +507 -0
- package/lib/controller/features/toggle-feature.js +223 -0
- package/lib/controller/features/trigger-feature.js +333 -0
- package/lib/controller/hub-device.js +185 -0
- package/lib/controller/subdevice.js +1537 -0
- package/lib/device-factory.js +463 -0
- package/lib/error-budget.js +138 -0
- package/lib/http-api.js +766 -0
- package/lib/manager.js +1609 -0
- package/lib/model/channel-info.js +79 -0
- package/lib/model/constants.js +119 -0
- package/lib/model/enums.js +819 -0
- package/lib/model/exception.js +363 -0
- package/lib/model/http/device.js +215 -0
- package/lib/model/http/error-codes.js +121 -0
- package/lib/model/http/exception.js +151 -0
- package/lib/model/http/subdevice.js +133 -0
- package/lib/model/push/alarm.js +112 -0
- package/lib/model/push/bind.js +97 -0
- package/lib/model/push/common.js +282 -0
- package/lib/model/push/diffuser-light.js +100 -0
- package/lib/model/push/diffuser-spray.js +83 -0
- package/lib/model/push/factory.js +229 -0
- package/lib/model/push/generic.js +115 -0
- package/lib/model/push/hub-battery.js +59 -0
- package/lib/model/push/hub-mts100-all.js +64 -0
- package/lib/model/push/hub-mts100-mode.js +59 -0
- package/lib/model/push/hub-mts100-temperature.js +62 -0
- package/lib/model/push/hub-online.js +59 -0
- package/lib/model/push/hub-sensor-alert.js +61 -0
- package/lib/model/push/hub-sensor-all.js +59 -0
- package/lib/model/push/hub-sensor-smoke.js +110 -0
- package/lib/model/push/hub-sensor-temphum.js +62 -0
- package/lib/model/push/hub-subdevicelist.js +50 -0
- package/lib/model/push/hub-togglex.js +60 -0
- package/lib/model/push/index.js +81 -0
- package/lib/model/push/online.js +53 -0
- package/lib/model/push/presence-study.js +61 -0
- package/lib/model/push/sensor-latestx.js +106 -0
- package/lib/model/push/timerx.js +63 -0
- package/lib/model/push/togglex.js +78 -0
- package/lib/model/push/triggerx.js +62 -0
- package/lib/model/push/unbind.js +34 -0
- package/lib/model/push/water-leak.js +107 -0
- package/lib/model/states/diffuser-light-state.js +119 -0
- package/lib/model/states/diffuser-spray-state.js +58 -0
- package/lib/model/states/garage-door-state.js +71 -0
- package/lib/model/states/index.js +38 -0
- package/lib/model/states/light-state.js +134 -0
- package/lib/model/states/presence-sensor-state.js +239 -0
- package/lib/model/states/roller-shutter-state.js +82 -0
- package/lib/model/states/spray-state.js +58 -0
- package/lib/model/states/thermostat-state.js +297 -0
- package/lib/model/states/timer-state.js +192 -0
- package/lib/model/states/toggle-state.js +105 -0
- package/lib/model/states/trigger-state.js +155 -0
- package/lib/subscription.js +587 -0
- package/lib/utilities/conversion.js +62 -0
- package/lib/utilities/debug.js +165 -0
- package/lib/utilities/mqtt.js +152 -0
- package/lib/utilities/network.js +53 -0
- package/lib/utilities/options.js +64 -0
- package/lib/utilities/request-queue.js +161 -0
- package/lib/utilities/ssid.js +37 -0
- package/lib/utilities/state-changes.js +66 -0
- package/lib/utilities/stats.js +687 -0
- package/lib/utilities/timer.js +310 -0
- package/lib/utilities/trigger.js +286 -0
- package/package.json +73 -0
package/index.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Main entry point - re-export everything from new modular structure
|
|
4
|
+
const MerossManager = require('./lib/manager');
|
|
5
|
+
const enums = require('./lib/model/enums');
|
|
6
|
+
const errors = require('./lib/model/exception');
|
|
7
|
+
const states = require('./lib/model/states');
|
|
8
|
+
const push = require('./lib/model/push');
|
|
9
|
+
|
|
10
|
+
// Export main class
|
|
11
|
+
module.exports = MerossManager;
|
|
12
|
+
|
|
13
|
+
// Export error classes
|
|
14
|
+
const httpExceptions = require('./lib/model/http/exception');
|
|
15
|
+
module.exports.MerossError = errors.MerossError;
|
|
16
|
+
module.exports.HttpApiError = httpExceptions.HttpApiError;
|
|
17
|
+
module.exports.AuthenticationError = errors.AuthenticationError;
|
|
18
|
+
module.exports.MFARequiredError = httpExceptions.MFARequiredError;
|
|
19
|
+
module.exports.MissingMFAError = httpExceptions.MissingMFAError;
|
|
20
|
+
module.exports.WrongMFAError = httpExceptions.WrongMFAError;
|
|
21
|
+
module.exports.TokenExpiredError = httpExceptions.TokenExpiredError;
|
|
22
|
+
module.exports.TooManyTokensError = httpExceptions.TooManyTokensError;
|
|
23
|
+
module.exports.UnauthorizedError = httpExceptions.UnauthorizedError;
|
|
24
|
+
module.exports.BadDomainError = httpExceptions.BadDomainError;
|
|
25
|
+
module.exports.ApiLimitReachedError = errors.ApiLimitReachedError;
|
|
26
|
+
module.exports.ResourceAccessDeniedError = errors.ResourceAccessDeniedError;
|
|
27
|
+
module.exports.CommandTimeoutError = errors.CommandTimeoutError;
|
|
28
|
+
module.exports.CommandError = errors.CommandError;
|
|
29
|
+
module.exports.MqttError = errors.MqttError;
|
|
30
|
+
module.exports.UnconnectedError = errors.UnconnectedError;
|
|
31
|
+
module.exports.UnknownDeviceTypeError = errors.UnknownDeviceTypeError;
|
|
32
|
+
module.exports.mapErrorCodeToError = errors.mapErrorCodeToError;
|
|
33
|
+
|
|
34
|
+
// Export enums
|
|
35
|
+
module.exports.TransportMode = enums.TransportMode;
|
|
36
|
+
module.exports.ThermostatMode = enums.ThermostatMode;
|
|
37
|
+
module.exports.ThermostatWorkingMode = enums.ThermostatWorkingMode;
|
|
38
|
+
module.exports.ThermostatModeBState = enums.ThermostatModeBState;
|
|
39
|
+
module.exports.LightMode = enums.LightMode;
|
|
40
|
+
module.exports.DiffuserLightMode = enums.DiffuserLightMode;
|
|
41
|
+
module.exports.DiffuserSprayMode = enums.DiffuserSprayMode;
|
|
42
|
+
module.exports.SprayMode = enums.SprayMode;
|
|
43
|
+
module.exports.RollerShutterStatus = enums.RollerShutterStatus;
|
|
44
|
+
module.exports.DNDMode = enums.DNDMode;
|
|
45
|
+
module.exports.OnlineStatus = enums.OnlineStatus;
|
|
46
|
+
module.exports.SmokeAlarmStatus = enums.SmokeAlarmStatus;
|
|
47
|
+
module.exports.TimerType = enums.TimerType;
|
|
48
|
+
module.exports.TriggerType = enums.TriggerType;
|
|
49
|
+
module.exports.PresenceState = enums.PresenceState;
|
|
50
|
+
module.exports.SensitivityLevel = enums.SensitivityLevel;
|
|
51
|
+
module.exports.WorkMode = enums.WorkMode;
|
|
52
|
+
|
|
53
|
+
// Export state classes
|
|
54
|
+
module.exports.ThermostatState = states.ThermostatState;
|
|
55
|
+
module.exports.LightState = states.LightState;
|
|
56
|
+
module.exports.DiffuserLightState = states.DiffuserLightState;
|
|
57
|
+
module.exports.DiffuserSprayState = states.DiffuserSprayState;
|
|
58
|
+
module.exports.SprayState = states.SprayState;
|
|
59
|
+
module.exports.RollerShutterState = states.RollerShutterState;
|
|
60
|
+
module.exports.GarageDoorState = states.GarageDoorState;
|
|
61
|
+
module.exports.TimerState = states.TimerState;
|
|
62
|
+
module.exports.TriggerState = states.TriggerState;
|
|
63
|
+
module.exports.ToggleState = states.ToggleState;
|
|
64
|
+
module.exports.PresenceSensorState = states.PresenceSensorState;
|
|
65
|
+
|
|
66
|
+
// Export model classes
|
|
67
|
+
const ChannelInfo = require('./lib/model/channel-info');
|
|
68
|
+
const HttpDeviceInfo = require('./lib/model/http/device');
|
|
69
|
+
const HttpSubdeviceInfo = require('./lib/model/http/subdevice');
|
|
70
|
+
module.exports.ChannelInfo = ChannelInfo;
|
|
71
|
+
module.exports.HttpDeviceInfo = HttpDeviceInfo;
|
|
72
|
+
module.exports.HttpSubdeviceInfo = HttpSubdeviceInfo;
|
|
73
|
+
|
|
74
|
+
// Export push notification classes
|
|
75
|
+
module.exports.GenericPushNotification = push.GenericPushNotification;
|
|
76
|
+
module.exports.OnlinePushNotification = push.OnlinePushNotification;
|
|
77
|
+
module.exports.AlarmPushNotification = push.AlarmPushNotification;
|
|
78
|
+
module.exports.BindPushNotification = push.BindPushNotification;
|
|
79
|
+
module.exports.UnbindPushNotification = push.UnbindPushNotification;
|
|
80
|
+
module.exports.WaterLeakPushNotification = push.WaterLeakPushNotification;
|
|
81
|
+
module.exports.HubOnlinePushNotification = push.HubOnlinePushNotification;
|
|
82
|
+
module.exports.HubToggleXPushNotification = push.HubToggleXPushNotification;
|
|
83
|
+
module.exports.HubBatteryPushNotification = push.HubBatteryPushNotification;
|
|
84
|
+
module.exports.HubSensorAllPushNotification = push.HubSensorAllPushNotification;
|
|
85
|
+
module.exports.HubSensorTempHumPushNotification = push.HubSensorTempHumPushNotification;
|
|
86
|
+
module.exports.HubSensorAlertPushNotification = push.HubSensorAlertPushNotification;
|
|
87
|
+
module.exports.HubSensorSmokePushNotification = push.HubSensorSmokePushNotification;
|
|
88
|
+
module.exports.HubMts100AllPushNotification = push.HubMts100AllPushNotification;
|
|
89
|
+
module.exports.HubMts100ModePushNotification = push.HubMts100ModePushNotification;
|
|
90
|
+
module.exports.HubMts100TemperaturePushNotification = push.HubMts100TemperaturePushNotification;
|
|
91
|
+
module.exports.HubSubdeviceListPushNotification = push.HubSubdeviceListPushNotification;
|
|
92
|
+
module.exports.SensorLatestXPushNotification = push.SensorLatestXPushNotification;
|
|
93
|
+
module.exports.TimerXPushNotification = push.TimerXPushNotification;
|
|
94
|
+
module.exports.TriggerXPushNotification = push.TriggerXPushNotification;
|
|
95
|
+
module.exports.ToggleXPushNotification = push.ToggleXPushNotification;
|
|
96
|
+
module.exports.PresenceStudyPushNotification = push.PresenceStudyPushNotification;
|
|
97
|
+
module.exports.DiffuserLightPushNotification = push.DiffuserLightPushNotification;
|
|
98
|
+
module.exports.DiffuserSprayPushNotification = push.DiffuserSprayPushNotification;
|
|
99
|
+
module.exports.HardwareInfo = push.HardwareInfo;
|
|
100
|
+
module.exports.FirmwareInfo = push.FirmwareInfo;
|
|
101
|
+
module.exports.TimeInfo = push.TimeInfo;
|
|
102
|
+
module.exports.parsePushNotification = push.parsePushNotification;
|
|
103
|
+
|
|
104
|
+
// Export timer utilities
|
|
105
|
+
module.exports.TimerUtils = require('./lib/utilities/timer');
|
|
106
|
+
// Export trigger utilities
|
|
107
|
+
module.exports.TriggerUtils = require('./lib/utilities/trigger');
|
|
108
|
+
// Export debug utilities
|
|
109
|
+
module.exports.createDebugUtils = require('./lib/utilities/debug').createDebugUtils;
|
|
110
|
+
|
|
111
|
+
// Export device classes
|
|
112
|
+
const baseDevice = require('./lib/controller/device');
|
|
113
|
+
const hubDevice = require('./lib/controller/hub-device');
|
|
114
|
+
module.exports.MerossDevice = baseDevice.MerossDevice;
|
|
115
|
+
module.exports.MerossHubDevice = hubDevice.MerossHubDevice;
|
|
116
|
+
|
|
117
|
+
// Export subdevice classes
|
|
118
|
+
const subdevice = require('./lib/controller/subdevice');
|
|
119
|
+
module.exports.MerossSubDevice = subdevice.MerossSubDevice;
|
|
120
|
+
module.exports.HubTempHumSensor = subdevice.HubTempHumSensor;
|
|
121
|
+
module.exports.HubThermostatValve = subdevice.HubThermostatValve;
|
|
122
|
+
module.exports.HubWaterLeakSensor = subdevice.HubWaterLeakSensor;
|
|
123
|
+
module.exports.HubSmokeDetector = subdevice.HubSmokeDetector;
|
|
124
|
+
|
|
125
|
+
// Export HTTP client class (for dependency injection pattern)
|
|
126
|
+
const MerossHttpClient = require('./lib/http-api');
|
|
127
|
+
module.exports.MerossHttpClient = MerossHttpClient;
|
|
128
|
+
|
|
129
|
+
// Export SubscriptionManager class
|
|
130
|
+
const SubscriptionManager = require('./lib/subscription');
|
|
131
|
+
module.exports.SubscriptionManager = SubscriptionManager;
|