matterbridge 3.3.4-dev-20251020-4d2dd49 → 3.3.4-dev-20251020-df40d12
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 +1 -0
- package/dist/cli.js +7 -6
- package/dist/devices/airConditioner.js +2 -2
- package/dist/devices/batteryStorage.js +3 -3
- package/dist/devices/dishwasher.js +4 -4
- package/dist/devices/evse.js +6 -5
- package/dist/devices/extractorHood.js +1 -1
- package/dist/devices/heatPump.js +2 -2
- package/dist/devices/laundryDryer.js +3 -3
- package/dist/devices/laundryWasher.js +5 -5
- package/dist/devices/microwaveOven.js +5 -5
- package/dist/devices/oven.js +5 -5
- package/dist/devices/refrigerator.js +4 -4
- package/dist/devices/roboticVacuumCleaner.js +11 -11
- package/dist/devices/solarPower.js +2 -2
- package/dist/devices/speaker.js +2 -1
- package/dist/devices/temperatureControl.js +2 -2
- package/dist/devices/waterHeater.js +6 -6
- package/dist/frontend.js +27 -26
- package/dist/helpers.js +1 -1
- package/dist/matterbridge.js +17 -13
- package/dist/matterbridgeAccessoryPlatform.js +2 -0
- package/dist/matterbridgeBehaviors.js +20 -20
- package/dist/matterbridgeDeviceTypes.js +85 -85
- package/dist/matterbridgeDynamicPlatform.js +2 -0
- package/dist/matterbridgeEndpoint.js +64 -61
- package/dist/matterbridgeEndpointHelpers.js +78 -75
- package/dist/matterbridgePlatform.js +2 -2
- package/dist/update.js +1 -1
- package/dist/utils/format.js +29 -0
- package/dist/utils/jestHelpers.js +7 -3
- package/dist/utils/network.js +0 -26
- package/dist/utils/tracker.js +17 -45
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { DeviceTypeId } from '@matter/
|
|
2
|
-
import { AccountLogin } from '@matter/
|
|
3
|
-
import { Actions } from '@matter/
|
|
4
|
-
import { ActivatedCarbonFilterMonitoring } from '@matter/
|
|
5
|
-
import { AdministratorCommissioning } from '@matter/
|
|
6
|
-
import { AirQuality } from '@matter/
|
|
7
|
-
import { ApplicationLauncher } from '@matter/
|
|
8
|
-
import { AudioOutput } from '@matter/
|
|
9
|
-
import { BooleanState } from '@matter/
|
|
10
|
-
import { BooleanStateConfiguration } from '@matter/
|
|
11
|
-
import { BridgedDeviceBasicInformation } from '@matter/
|
|
12
|
-
import { CarbonDioxideConcentrationMeasurement } from '@matter/
|
|
13
|
-
import { CarbonMonoxideConcentrationMeasurement } from '@matter/
|
|
14
|
-
import { Channel } from '@matter/
|
|
15
|
-
import { ColorControl } from '@matter/
|
|
16
|
-
import { CommissionerControl } from '@matter/
|
|
17
|
-
import { ContentControl } from '@matter/
|
|
18
|
-
import { ContentLauncher } from '@matter/
|
|
19
|
-
import { DeviceEnergyManagement } from '@matter/
|
|
20
|
-
import { DeviceEnergyManagementMode } from '@matter/
|
|
21
|
-
import { DishwasherAlarm } from '@matter/
|
|
22
|
-
import { DishwasherMode } from '@matter/
|
|
23
|
-
import { DoorLock } from '@matter/
|
|
24
|
-
import { EcosystemInformation } from '@matter/
|
|
25
|
-
import { ElectricalEnergyMeasurement } from '@matter/
|
|
26
|
-
import { ElectricalPowerMeasurement } from '@matter/
|
|
27
|
-
import { EnergyEvse } from '@matter/
|
|
28
|
-
import { EnergyEvseMode } from '@matter/
|
|
29
|
-
import { EnergyPreference } from '@matter/
|
|
30
|
-
import { FanControl } from '@matter/
|
|
31
|
-
import { FlowMeasurement } from '@matter/
|
|
32
|
-
import { FormaldehydeConcentrationMeasurement } from '@matter/
|
|
33
|
-
import { Groups } from '@matter/
|
|
34
|
-
import { HepaFilterMonitoring } from '@matter/
|
|
35
|
-
import { Identify } from '@matter/
|
|
36
|
-
import { IlluminanceMeasurement } from '@matter/
|
|
37
|
-
import { KeypadInput } from '@matter/
|
|
38
|
-
import { LaundryDryerControls } from '@matter/
|
|
39
|
-
import { LaundryWasherControls } from '@matter/
|
|
40
|
-
import { LaundryWasherMode } from '@matter/
|
|
41
|
-
import { LevelControl } from '@matter/
|
|
42
|
-
import { LowPower } from '@matter/
|
|
43
|
-
import { MediaInput } from '@matter/
|
|
44
|
-
import { MediaPlayback } from '@matter/
|
|
45
|
-
import { Messages } from '@matter/
|
|
46
|
-
import { MicrowaveOvenControl } from '@matter/
|
|
47
|
-
import { MicrowaveOvenMode } from '@matter/
|
|
48
|
-
import { ModeSelect } from '@matter/
|
|
49
|
-
import { NitrogenDioxideConcentrationMeasurement } from '@matter/
|
|
50
|
-
import { OccupancySensing } from '@matter/
|
|
51
|
-
import { OnOff } from '@matter/
|
|
52
|
-
import { OperationalState } from '@matter/
|
|
53
|
-
import { OtaSoftwareUpdateProvider } from '@matter/
|
|
54
|
-
import { OtaSoftwareUpdateRequestor } from '@matter/
|
|
55
|
-
import { OvenCavityOperationalState } from '@matter/
|
|
56
|
-
import { OvenMode } from '@matter/
|
|
57
|
-
import { OzoneConcentrationMeasurement } from '@matter/
|
|
58
|
-
import { Pm1ConcentrationMeasurement } from '@matter/
|
|
59
|
-
import { Pm10ConcentrationMeasurement } from '@matter/
|
|
60
|
-
import { Pm25ConcentrationMeasurement } from '@matter/
|
|
61
|
-
import { PowerSource } from '@matter/
|
|
62
|
-
import { PowerTopology } from '@matter/
|
|
63
|
-
import { PressureMeasurement } from '@matter/
|
|
64
|
-
import { PumpConfigurationAndControl } from '@matter/
|
|
65
|
-
import { RadonConcentrationMeasurement } from '@matter/
|
|
66
|
-
import { RefrigeratorAlarm } from '@matter/
|
|
67
|
-
import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/
|
|
68
|
-
import { RelativeHumidityMeasurement } from '@matter/
|
|
69
|
-
import { RvcCleanMode } from '@matter/
|
|
70
|
-
import { RvcOperationalState } from '@matter/
|
|
71
|
-
import { RvcRunMode } from '@matter/
|
|
72
|
-
import { ServiceArea } from '@matter/
|
|
73
|
-
import { SmokeCoAlarm } from '@matter/
|
|
74
|
-
import { Switch } from '@matter/
|
|
75
|
-
import { TargetNavigator } from '@matter/
|
|
76
|
-
import { TemperatureControl } from '@matter/
|
|
77
|
-
import { TemperatureMeasurement } from '@matter/
|
|
78
|
-
import { Thermostat } from '@matter/
|
|
79
|
-
import { ThermostatUserInterfaceConfiguration } from '@matter/
|
|
80
|
-
import { TotalVolatileOrganicCompoundsConcentrationMeasurement } from '@matter/
|
|
81
|
-
import { ValveConfigurationAndControl } from '@matter/
|
|
82
|
-
import { WakeOnLan } from '@matter/
|
|
83
|
-
import { WaterHeaterManagement } from '@matter/
|
|
84
|
-
import { WaterHeaterMode } from '@matter/
|
|
85
|
-
import { WindowCovering } from '@matter/
|
|
1
|
+
import { DeviceTypeId } from '@matter/types';
|
|
2
|
+
import { AccountLogin } from '@matter/types/clusters/account-login';
|
|
3
|
+
import { Actions } from '@matter/types/clusters/actions';
|
|
4
|
+
import { ActivatedCarbonFilterMonitoring } from '@matter/types/clusters/activated-carbon-filter-monitoring';
|
|
5
|
+
import { AdministratorCommissioning } from '@matter/types/clusters/administrator-commissioning';
|
|
6
|
+
import { AirQuality } from '@matter/types/clusters/air-quality';
|
|
7
|
+
import { ApplicationLauncher } from '@matter/types/clusters/application-launcher';
|
|
8
|
+
import { AudioOutput } from '@matter/types/clusters/audio-output';
|
|
9
|
+
import { BooleanState } from '@matter/types/clusters/boolean-state';
|
|
10
|
+
import { BooleanStateConfiguration } from '@matter/types/clusters/boolean-state-configuration';
|
|
11
|
+
import { BridgedDeviceBasicInformation } from '@matter/types/clusters/bridged-device-basic-information';
|
|
12
|
+
import { CarbonDioxideConcentrationMeasurement } from '@matter/types/clusters/carbon-dioxide-concentration-measurement';
|
|
13
|
+
import { CarbonMonoxideConcentrationMeasurement } from '@matter/types/clusters/carbon-monoxide-concentration-measurement';
|
|
14
|
+
import { Channel } from '@matter/types/clusters/channel';
|
|
15
|
+
import { ColorControl } from '@matter/types/clusters/color-control';
|
|
16
|
+
import { CommissionerControl } from '@matter/types/clusters/commissioner-control';
|
|
17
|
+
import { ContentControl } from '@matter/types/clusters/content-control';
|
|
18
|
+
import { ContentLauncher } from '@matter/types/clusters/content-launcher';
|
|
19
|
+
import { DeviceEnergyManagement } from '@matter/types/clusters/device-energy-management';
|
|
20
|
+
import { DeviceEnergyManagementMode } from '@matter/types/clusters/device-energy-management-mode';
|
|
21
|
+
import { DishwasherAlarm } from '@matter/types/clusters/dishwasher-alarm';
|
|
22
|
+
import { DishwasherMode } from '@matter/types/clusters/dishwasher-mode';
|
|
23
|
+
import { DoorLock } from '@matter/types/clusters/door-lock';
|
|
24
|
+
import { EcosystemInformation } from '@matter/types/clusters/ecosystem-information';
|
|
25
|
+
import { ElectricalEnergyMeasurement } from '@matter/types/clusters/electrical-energy-measurement';
|
|
26
|
+
import { ElectricalPowerMeasurement } from '@matter/types/clusters/electrical-power-measurement';
|
|
27
|
+
import { EnergyEvse } from '@matter/types/clusters/energy-evse';
|
|
28
|
+
import { EnergyEvseMode } from '@matter/types/clusters/energy-evse-mode';
|
|
29
|
+
import { EnergyPreference } from '@matter/types/clusters/energy-preference';
|
|
30
|
+
import { FanControl } from '@matter/types/clusters/fan-control';
|
|
31
|
+
import { FlowMeasurement } from '@matter/types/clusters/flow-measurement';
|
|
32
|
+
import { FormaldehydeConcentrationMeasurement } from '@matter/types/clusters/formaldehyde-concentration-measurement';
|
|
33
|
+
import { Groups } from '@matter/types/clusters/groups';
|
|
34
|
+
import { HepaFilterMonitoring } from '@matter/types/clusters/hepa-filter-monitoring';
|
|
35
|
+
import { Identify } from '@matter/types/clusters/identify';
|
|
36
|
+
import { IlluminanceMeasurement } from '@matter/types/clusters/illuminance-measurement';
|
|
37
|
+
import { KeypadInput } from '@matter/types/clusters/keypad-input';
|
|
38
|
+
import { LaundryDryerControls } from '@matter/types/clusters/laundry-dryer-controls';
|
|
39
|
+
import { LaundryWasherControls } from '@matter/types/clusters/laundry-washer-controls';
|
|
40
|
+
import { LaundryWasherMode } from '@matter/types/clusters/laundry-washer-mode';
|
|
41
|
+
import { LevelControl } from '@matter/types/clusters/level-control';
|
|
42
|
+
import { LowPower } from '@matter/types/clusters/low-power';
|
|
43
|
+
import { MediaInput } from '@matter/types/clusters/media-input';
|
|
44
|
+
import { MediaPlayback } from '@matter/types/clusters/media-playback';
|
|
45
|
+
import { Messages } from '@matter/types/clusters/messages';
|
|
46
|
+
import { MicrowaveOvenControl } from '@matter/types/clusters/microwave-oven-control';
|
|
47
|
+
import { MicrowaveOvenMode } from '@matter/types/clusters/microwave-oven-mode';
|
|
48
|
+
import { ModeSelect } from '@matter/types/clusters/mode-select';
|
|
49
|
+
import { NitrogenDioxideConcentrationMeasurement } from '@matter/types/clusters/nitrogen-dioxide-concentration-measurement';
|
|
50
|
+
import { OccupancySensing } from '@matter/types/clusters/occupancy-sensing';
|
|
51
|
+
import { OnOff } from '@matter/types/clusters/on-off';
|
|
52
|
+
import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
53
|
+
import { OtaSoftwareUpdateProvider } from '@matter/types/clusters/ota-software-update-provider';
|
|
54
|
+
import { OtaSoftwareUpdateRequestor } from '@matter/types/clusters/ota-software-update-requestor';
|
|
55
|
+
import { OvenCavityOperationalState } from '@matter/types/clusters/oven-cavity-operational-state';
|
|
56
|
+
import { OvenMode } from '@matter/types/clusters/oven-mode';
|
|
57
|
+
import { OzoneConcentrationMeasurement } from '@matter/types/clusters/ozone-concentration-measurement';
|
|
58
|
+
import { Pm1ConcentrationMeasurement } from '@matter/types/clusters/pm1-concentration-measurement';
|
|
59
|
+
import { Pm10ConcentrationMeasurement } from '@matter/types/clusters/pm10-concentration-measurement';
|
|
60
|
+
import { Pm25ConcentrationMeasurement } from '@matter/types/clusters/pm25-concentration-measurement';
|
|
61
|
+
import { PowerSource } from '@matter/types/clusters/power-source';
|
|
62
|
+
import { PowerTopology } from '@matter/types/clusters/power-topology';
|
|
63
|
+
import { PressureMeasurement } from '@matter/types/clusters/pressure-measurement';
|
|
64
|
+
import { PumpConfigurationAndControl } from '@matter/types/clusters/pump-configuration-and-control';
|
|
65
|
+
import { RadonConcentrationMeasurement } from '@matter/types/clusters/radon-concentration-measurement';
|
|
66
|
+
import { RefrigeratorAlarm } from '@matter/types/clusters/refrigerator-alarm';
|
|
67
|
+
import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/types/clusters/refrigerator-and-temperature-controlled-cabinet-mode';
|
|
68
|
+
import { RelativeHumidityMeasurement } from '@matter/types/clusters/relative-humidity-measurement';
|
|
69
|
+
import { RvcCleanMode } from '@matter/types/clusters/rvc-clean-mode';
|
|
70
|
+
import { RvcOperationalState } from '@matter/types/clusters/rvc-operational-state';
|
|
71
|
+
import { RvcRunMode } from '@matter/types/clusters/rvc-run-mode';
|
|
72
|
+
import { ServiceArea } from '@matter/types/clusters/service-area';
|
|
73
|
+
import { SmokeCoAlarm } from '@matter/types/clusters/smoke-co-alarm';
|
|
74
|
+
import { Switch } from '@matter/types/clusters/switch';
|
|
75
|
+
import { TargetNavigator } from '@matter/types/clusters/target-navigator';
|
|
76
|
+
import { TemperatureControl } from '@matter/types/clusters/temperature-control';
|
|
77
|
+
import { TemperatureMeasurement } from '@matter/types/clusters/temperature-measurement';
|
|
78
|
+
import { Thermostat } from '@matter/types/clusters/thermostat';
|
|
79
|
+
import { ThermostatUserInterfaceConfiguration } from '@matter/types/clusters/thermostat-user-interface-configuration';
|
|
80
|
+
import { TotalVolatileOrganicCompoundsConcentrationMeasurement } from '@matter/types/clusters/total-volatile-organic-compounds-concentration-measurement';
|
|
81
|
+
import { ValveConfigurationAndControl } from '@matter/types/clusters/valve-configuration-and-control';
|
|
82
|
+
import { WakeOnLan } from '@matter/types/clusters/wake-on-lan';
|
|
83
|
+
import { WaterHeaterManagement } from '@matter/types/clusters/water-heater-management';
|
|
84
|
+
import { WaterHeaterMode } from '@matter/types/clusters/water-heater-mode';
|
|
85
|
+
import { WindowCovering } from '@matter/types/clusters/window-covering';
|
|
86
86
|
export var DeviceClasses;
|
|
87
87
|
(function (DeviceClasses) {
|
|
88
88
|
DeviceClasses["Node"] = "Node";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
2
|
+
console.log('\u001B[32mMatterbridgeDynamicPlatform loaded.\u001B[40;0m');
|
|
1
3
|
import { MatterbridgePlatform } from './matterbridgePlatform.js';
|
|
2
4
|
export class MatterbridgeDynamicPlatform extends MatterbridgePlatform {
|
|
3
5
|
constructor(matterbridge, log, config) {
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
1
|
+
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
2
|
+
console.log('\u001B[32mMatterbridgeEndpoint loaded.\u001B[40;0m');
|
|
3
|
+
import { AnsiLogger, CYAN, YELLOW, db, debugStringify, hk, or, zb } from 'node-ansi-logger';
|
|
4
|
+
import { Endpoint, MutableEndpoint, SupportedBehaviors } from '@matter/node';
|
|
5
|
+
import { Lifecycle, NamedHandler, UINT16_MAX, UINT32_MAX } from '@matter/general';
|
|
6
|
+
import { getClusterNameById, VendorId } from '@matter/types';
|
|
7
|
+
import { Descriptor } from '@matter/types/clusters/descriptor';
|
|
8
|
+
import { PowerSource } from '@matter/types/clusters/power-source';
|
|
9
|
+
import { BridgedDeviceBasicInformation } from '@matter/types/clusters/bridged-device-basic-information';
|
|
10
|
+
import { Identify } from '@matter/types/clusters/identify';
|
|
11
|
+
import { OnOff } from '@matter/types/clusters/on-off';
|
|
12
|
+
import { LevelControl } from '@matter/types/clusters/level-control';
|
|
13
|
+
import { ColorControl } from '@matter/types/clusters/color-control';
|
|
14
|
+
import { WindowCovering } from '@matter/types/clusters/window-covering';
|
|
15
|
+
import { Thermostat } from '@matter/types/clusters/thermostat';
|
|
16
|
+
import { FanControl } from '@matter/types/clusters/fan-control';
|
|
17
|
+
import { DoorLock } from '@matter/types/clusters/door-lock';
|
|
18
|
+
import { ValveConfigurationAndControl } from '@matter/types/clusters/valve-configuration-and-control';
|
|
19
|
+
import { PumpConfigurationAndControl } from '@matter/types/clusters/pump-configuration-and-control';
|
|
20
|
+
import { SmokeCoAlarm } from '@matter/types/clusters/smoke-co-alarm';
|
|
21
|
+
import { Switch } from '@matter/types/clusters/switch';
|
|
22
|
+
import { BooleanStateConfiguration } from '@matter/types/clusters/boolean-state-configuration';
|
|
23
|
+
import { PowerTopology } from '@matter/types/clusters/power-topology';
|
|
24
|
+
import { ElectricalPowerMeasurement } from '@matter/types/clusters/electrical-power-measurement';
|
|
25
|
+
import { ElectricalEnergyMeasurement } from '@matter/types/clusters/electrical-energy-measurement';
|
|
26
|
+
import { AirQuality } from '@matter/types/clusters/air-quality';
|
|
27
|
+
import { ConcentrationMeasurement } from '@matter/types/clusters/concentration-measurement';
|
|
28
|
+
import { OccupancySensing } from '@matter/types/clusters/occupancy-sensing';
|
|
29
|
+
import { ThermostatUserInterfaceConfiguration } from '@matter/types/clusters/thermostat-user-interface-configuration';
|
|
30
|
+
import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
31
|
+
import { DeviceEnergyManagement } from '@matter/types/clusters/device-energy-management';
|
|
32
|
+
import { DeviceEnergyManagementMode } from '@matter/types/clusters/device-energy-management-mode';
|
|
33
|
+
import { ResourceMonitoring } from '@matter/types/clusters/resource-monitoring';
|
|
34
|
+
import { DescriptorServer } from '@matter/node/behaviors/descriptor';
|
|
35
|
+
import { PowerSourceServer } from '@matter/node/behaviors/power-source';
|
|
36
|
+
import { BridgedDeviceBasicInformationServer } from '@matter/node/behaviors/bridged-device-basic-information';
|
|
37
|
+
import { GroupsServer } from '@matter/node/behaviors/groups';
|
|
38
|
+
import { ScenesManagementServer } from '@matter/node/behaviors/scenes-management';
|
|
39
|
+
import { PumpConfigurationAndControlServer } from '@matter/node/behaviors/pump-configuration-and-control';
|
|
40
|
+
import { SwitchServer } from '@matter/node/behaviors/switch';
|
|
41
|
+
import { BooleanStateServer } from '@matter/node/behaviors/boolean-state';
|
|
42
|
+
import { PowerTopologyServer } from '@matter/node/behaviors/power-topology';
|
|
43
|
+
import { ElectricalPowerMeasurementServer } from '@matter/node/behaviors/electrical-power-measurement';
|
|
44
|
+
import { ElectricalEnergyMeasurementServer } from '@matter/node/behaviors/electrical-energy-measurement';
|
|
45
|
+
import { TemperatureMeasurementServer } from '@matter/node/behaviors/temperature-measurement';
|
|
46
|
+
import { RelativeHumidityMeasurementServer } from '@matter/node/behaviors/relative-humidity-measurement';
|
|
47
|
+
import { PressureMeasurementServer } from '@matter/node/behaviors/pressure-measurement';
|
|
48
|
+
import { FlowMeasurementServer } from '@matter/node/behaviors/flow-measurement';
|
|
49
|
+
import { IlluminanceMeasurementServer } from '@matter/node/behaviors/illuminance-measurement';
|
|
50
|
+
import { OccupancySensingServer } from '@matter/node/behaviors/occupancy-sensing';
|
|
51
|
+
import { AirQualityServer } from '@matter/node/behaviors/air-quality';
|
|
52
|
+
import { CarbonMonoxideConcentrationMeasurementServer } from '@matter/node/behaviors/carbon-monoxide-concentration-measurement';
|
|
53
|
+
import { CarbonDioxideConcentrationMeasurementServer } from '@matter/node/behaviors/carbon-dioxide-concentration-measurement';
|
|
54
|
+
import { NitrogenDioxideConcentrationMeasurementServer } from '@matter/node/behaviors/nitrogen-dioxide-concentration-measurement';
|
|
55
|
+
import { OzoneConcentrationMeasurementServer } from '@matter/node/behaviors/ozone-concentration-measurement';
|
|
56
|
+
import { FormaldehydeConcentrationMeasurementServer } from '@matter/node/behaviors/formaldehyde-concentration-measurement';
|
|
57
|
+
import { Pm1ConcentrationMeasurementServer } from '@matter/node/behaviors/pm1-concentration-measurement';
|
|
58
|
+
import { Pm25ConcentrationMeasurementServer } from '@matter/node/behaviors/pm25-concentration-measurement';
|
|
59
|
+
import { Pm10ConcentrationMeasurementServer } from '@matter/node/behaviors/pm10-concentration-measurement';
|
|
60
|
+
import { RadonConcentrationMeasurementServer } from '@matter/node/behaviors/radon-concentration-measurement';
|
|
61
|
+
import { TotalVolatileOrganicCompoundsConcentrationMeasurementServer } from '@matter/node/behaviors/total-volatile-organic-compounds-concentration-measurement';
|
|
62
|
+
import { FanControlServer } from '@matter/node/behaviors/fan-control';
|
|
63
|
+
import { ThermostatUserInterfaceConfigurationServer } from '@matter/node/behaviors/thermostat-user-interface-configuration';
|
|
64
|
+
import { isValidNumber, isValidObject, isValidString } from './utils/isvalid.js';
|
|
62
65
|
import { MatterbridgeServer, MatterbridgeIdentifyServer, MatterbridgeOnOffServer, MatterbridgeLevelControlServer, MatterbridgeColorControlServer, MatterbridgeLiftWindowCoveringServer, MatterbridgeLiftTiltWindowCoveringServer, MatterbridgeThermostatServer, MatterbridgeFanControlServer, MatterbridgeDoorLockServer, MatterbridgeModeSelectServer, MatterbridgeValveConfigurationAndControlServer, MatterbridgeSmokeCoAlarmServer, MatterbridgeBooleanStateConfigurationServer, MatterbridgeSwitchServer, MatterbridgeOperationalStateServer, MatterbridgeDeviceEnergyManagementModeServer, MatterbridgeDeviceEnergyManagementServer, MatterbridgeActivatedCarbonFilterMonitoringServer, MatterbridgeHepaFilterMonitoringServer, MatterbridgeEnhancedColorControlServer, } from './matterbridgeBehaviors.js';
|
|
63
66
|
import { addClusterServers, addFixedLabel, addOptionalClusterServers, addRequiredClusterServers, addUserLabel, createUniqueId, getBehavior, getBehaviourTypesFromClusterClientIds, getBehaviourTypesFromClusterServerIds, getDefaultOperationalStateClusterServer, getDefaultFlowMeasurementClusterServer, getDefaultIlluminanceMeasurementClusterServer, getDefaultPressureMeasurementClusterServer, getDefaultRelativeHumidityMeasurementClusterServer, getDefaultTemperatureMeasurementClusterServer, getDefaultOccupancySensingClusterServer, getDefaultElectricalEnergyMeasurementClusterServer, getDefaultElectricalPowerMeasurementClusterServer, getApparentElectricalPowerMeasurementClusterServer, lowercaseFirstLetter, updateAttribute, getClusterId, getAttributeId, setAttribute, getAttribute, checkNotLatinCharacters, generateUniqueId, subscribeAttribute, invokeBehaviorCommand, triggerEvent, featuresFor, } from './matterbridgeEndpointHelpers.js';
|
|
64
67
|
export class MatterbridgeEndpoint extends Endpoint {
|
|
@@ -1,80 +1,83 @@
|
|
|
1
|
+
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
2
|
+
console.log('\u001B[32mMatterbridgeEndpointHelpers loaded.\u001B[40;0m');
|
|
1
3
|
import { createHash } from 'node:crypto';
|
|
2
4
|
import { BLUE, CYAN, db, debugStringify, er, hk, or, YELLOW, zb } from 'node-ansi-logger';
|
|
3
|
-
import { Lifecycle } from '@matter/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
5
|
+
import { Lifecycle } from '@matter/general';
|
|
6
|
+
import { MeasurementType } from '@matter/types/globals';
|
|
7
|
+
import { getClusterNameById } from '@matter/types/cluster';
|
|
8
|
+
import { PowerSource } from '@matter/types/clusters/power-source';
|
|
9
|
+
import { UserLabel } from '@matter/types/clusters/user-label';
|
|
10
|
+
import { FixedLabel } from '@matter/types/clusters/fixed-label';
|
|
11
|
+
import { BasicInformation } from '@matter/types/clusters/basic-information';
|
|
12
|
+
import { BridgedDeviceBasicInformation } from '@matter/types/clusters/bridged-device-basic-information';
|
|
13
|
+
import { Identify } from '@matter/types/clusters/identify';
|
|
14
|
+
import { Groups } from '@matter/types/clusters/groups';
|
|
15
|
+
import { OnOff } from '@matter/types/clusters/on-off';
|
|
16
|
+
import { LevelControl } from '@matter/types/clusters/level-control';
|
|
17
|
+
import { ColorControl } from '@matter/types/clusters/color-control';
|
|
18
|
+
import { WindowCovering } from '@matter/types/clusters/window-covering';
|
|
19
|
+
import { Thermostat } from '@matter/types/clusters/thermostat';
|
|
20
|
+
import { FanControl } from '@matter/types/clusters/fan-control';
|
|
21
|
+
import { DoorLock } from '@matter/types/clusters/door-lock';
|
|
22
|
+
import { ModeSelect } from '@matter/types/clusters/mode-select';
|
|
23
|
+
import { ValveConfigurationAndControl } from '@matter/types/clusters/valve-configuration-and-control';
|
|
24
|
+
import { PumpConfigurationAndControl } from '@matter/types/clusters/pump-configuration-and-control';
|
|
25
|
+
import { SmokeCoAlarm } from '@matter/types/clusters/smoke-co-alarm';
|
|
26
|
+
import { Switch } from '@matter/types/clusters/switch';
|
|
27
|
+
import { BooleanState } from '@matter/types/clusters/boolean-state';
|
|
28
|
+
import { BooleanStateConfiguration } from '@matter/types/clusters/boolean-state-configuration';
|
|
29
|
+
import { PowerTopology } from '@matter/types/clusters/power-topology';
|
|
30
|
+
import { ElectricalPowerMeasurement } from '@matter/types/clusters/electrical-power-measurement';
|
|
31
|
+
import { ElectricalEnergyMeasurement } from '@matter/types/clusters/electrical-energy-measurement';
|
|
32
|
+
import { TemperatureMeasurement } from '@matter/types/clusters/temperature-measurement';
|
|
33
|
+
import { RelativeHumidityMeasurement } from '@matter/types/clusters/relative-humidity-measurement';
|
|
34
|
+
import { PressureMeasurement } from '@matter/types/clusters/pressure-measurement';
|
|
35
|
+
import { FlowMeasurement } from '@matter/types/clusters/flow-measurement';
|
|
36
|
+
import { IlluminanceMeasurement } from '@matter/types/clusters/illuminance-measurement';
|
|
37
|
+
import { OccupancySensing } from '@matter/types/clusters/occupancy-sensing';
|
|
38
|
+
import { AirQuality } from '@matter/types/clusters/air-quality';
|
|
39
|
+
import { CarbonMonoxideConcentrationMeasurement } from '@matter/types/clusters/carbon-monoxide-concentration-measurement';
|
|
40
|
+
import { CarbonDioxideConcentrationMeasurement } from '@matter/types/clusters/carbon-dioxide-concentration-measurement';
|
|
41
|
+
import { NitrogenDioxideConcentrationMeasurement } from '@matter/types/clusters/nitrogen-dioxide-concentration-measurement';
|
|
42
|
+
import { OzoneConcentrationMeasurement } from '@matter/types/clusters/ozone-concentration-measurement';
|
|
43
|
+
import { FormaldehydeConcentrationMeasurement } from '@matter/types/clusters/formaldehyde-concentration-measurement';
|
|
44
|
+
import { Pm1ConcentrationMeasurement } from '@matter/types/clusters/pm1-concentration-measurement';
|
|
45
|
+
import { Pm25ConcentrationMeasurement } from '@matter/types/clusters/pm25-concentration-measurement';
|
|
46
|
+
import { Pm10ConcentrationMeasurement } from '@matter/types/clusters/pm10-concentration-measurement';
|
|
47
|
+
import { RadonConcentrationMeasurement } from '@matter/types/clusters/radon-concentration-measurement';
|
|
48
|
+
import { TotalVolatileOrganicCompoundsConcentrationMeasurement } from '@matter/types/clusters/total-volatile-organic-compounds-concentration-measurement';
|
|
49
|
+
import { OperationalState } from '@matter/types/clusters/operational-state';
|
|
50
|
+
import { DeviceEnergyManagement } from '@matter/types/clusters/device-energy-management';
|
|
51
|
+
import { DeviceEnergyManagementMode } from '@matter/types/clusters/device-energy-management-mode';
|
|
52
|
+
import { PowerSourceServer } from '@matter/node/behaviors/power-source';
|
|
53
|
+
import { UserLabelServer } from '@matter/node/behaviors/user-label';
|
|
54
|
+
import { FixedLabelServer } from '@matter/node/behaviors/fixed-label';
|
|
55
|
+
import { BasicInformationServer } from '@matter/node/behaviors/basic-information';
|
|
56
|
+
import { BridgedDeviceBasicInformationServer } from '@matter/node/behaviors/bridged-device-basic-information';
|
|
57
|
+
import { GroupsServer } from '@matter/node/behaviors/groups';
|
|
58
|
+
import { PumpConfigurationAndControlServer } from '@matter/node/behaviors/pump-configuration-and-control';
|
|
59
|
+
import { SwitchServer } from '@matter/node/behaviors/switch';
|
|
60
|
+
import { BooleanStateServer } from '@matter/node/behaviors/boolean-state';
|
|
61
|
+
import { PowerTopologyServer } from '@matter/node/behaviors/power-topology';
|
|
62
|
+
import { ElectricalPowerMeasurementServer } from '@matter/node/behaviors/electrical-power-measurement';
|
|
63
|
+
import { ElectricalEnergyMeasurementServer } from '@matter/node/behaviors/electrical-energy-measurement';
|
|
64
|
+
import { TemperatureMeasurementServer } from '@matter/node/behaviors/temperature-measurement';
|
|
65
|
+
import { RelativeHumidityMeasurementServer } from '@matter/node/behaviors/relative-humidity-measurement';
|
|
66
|
+
import { PressureMeasurementServer } from '@matter/node/behaviors/pressure-measurement';
|
|
67
|
+
import { FlowMeasurementServer } from '@matter/node/behaviors/flow-measurement';
|
|
68
|
+
import { IlluminanceMeasurementServer } from '@matter/node/behaviors/illuminance-measurement';
|
|
69
|
+
import { OccupancySensingServer } from '@matter/node/behaviors/occupancy-sensing';
|
|
70
|
+
import { AirQualityServer } from '@matter/node/behaviors/air-quality';
|
|
71
|
+
import { CarbonMonoxideConcentrationMeasurementServer } from '@matter/node/behaviors/carbon-monoxide-concentration-measurement';
|
|
72
|
+
import { CarbonDioxideConcentrationMeasurementServer } from '@matter/node/behaviors/carbon-dioxide-concentration-measurement';
|
|
73
|
+
import { NitrogenDioxideConcentrationMeasurementServer } from '@matter/node/behaviors/nitrogen-dioxide-concentration-measurement';
|
|
74
|
+
import { OzoneConcentrationMeasurementServer } from '@matter/node/behaviors/ozone-concentration-measurement';
|
|
75
|
+
import { FormaldehydeConcentrationMeasurementServer } from '@matter/node/behaviors/formaldehyde-concentration-measurement';
|
|
76
|
+
import { Pm1ConcentrationMeasurementServer } from '@matter/node/behaviors/pm1-concentration-measurement';
|
|
77
|
+
import { Pm25ConcentrationMeasurementServer } from '@matter/node/behaviors/pm25-concentration-measurement';
|
|
78
|
+
import { Pm10ConcentrationMeasurementServer } from '@matter/node/behaviors/pm10-concentration-measurement';
|
|
79
|
+
import { RadonConcentrationMeasurementServer } from '@matter/node/behaviors/radon-concentration-measurement';
|
|
80
|
+
import { TotalVolatileOrganicCompoundsConcentrationMeasurementServer } from '@matter/node/behaviors/total-volatile-organic-compounds-concentration-measurement';
|
|
78
81
|
import { DeviceEnergyManagementServer } from '@matter/node/behaviors/device-energy-management';
|
|
79
82
|
import { deepCopy, deepEqual, isValidArray } from './utils/export.js';
|
|
80
83
|
import { MatterbridgeIdentifyServer, MatterbridgeOnOffServer, MatterbridgeLevelControlServer, MatterbridgeColorControlServer, MatterbridgeLiftWindowCoveringServer, MatterbridgeThermostatServer, MatterbridgeFanControlServer, MatterbridgeDoorLockServer, MatterbridgeModeSelectServer, MatterbridgeValveConfigurationAndControlServer, MatterbridgeSmokeCoAlarmServer, MatterbridgeBooleanStateConfigurationServer, MatterbridgeOperationalStateServer, MatterbridgeDeviceEnergyManagementModeServer, } from './matterbridgeBehaviors.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
2
2
|
console.log('\u001B[32mMatterbridgePlatform loaded.\u001B[40;0m');
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { Descriptor } from '@matter/
|
|
5
|
-
import { BridgedDeviceBasicInformation } from '@matter/
|
|
4
|
+
import { Descriptor } from '@matter/types/clusters/descriptor';
|
|
5
|
+
import { BridgedDeviceBasicInformation } from '@matter/types/clusters/bridged-device-basic-information';
|
|
6
6
|
import { CYAN, db, er, nf, wr } from 'node-ansi-logger';
|
|
7
7
|
import { NodeStorageManager } from 'node-persist-manager';
|
|
8
8
|
import { checkNotLatinCharacters } from './matterbridgeEndpointHelpers.js';
|
package/dist/update.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { db, debugStringify, nt, wr } from 'node-ansi-logger';
|
|
2
2
|
import { plg } from './matterbridgeTypes.js';
|
|
3
|
-
import { isValidString } from './utils/isvalid.js';
|
|
4
3
|
export async function checkUpdates(matterbridge) {
|
|
5
4
|
const { hasParameter } = await import('./utils/commandLine.js');
|
|
6
5
|
const update = checkUpdatesAndLog(matterbridge);
|
|
@@ -26,6 +25,7 @@ export async function checkUpdates(matterbridge) {
|
|
|
26
25
|
}
|
|
27
26
|
export async function checkUpdatesAndLog(matterbridge) {
|
|
28
27
|
const { getGitHubUpdate } = await import('./utils/network.js');
|
|
28
|
+
const { isValidString } = await import('./utils/isvalid.js');
|
|
29
29
|
const branch = matterbridge.matterbridgeVersion.includes('-dev-') ? 'dev' : 'main';
|
|
30
30
|
try {
|
|
31
31
|
const updateJson = await getGitHubUpdate(branch, 'update.json', 5_000);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function formatTimeStamp(timestamp) {
|
|
2
|
+
return `${new Date(timestamp).toLocaleString()}`;
|
|
3
|
+
}
|
|
4
|
+
export function formatPercent(percent, digits = 2) {
|
|
5
|
+
return `${percent.toFixed(digits)} %`;
|
|
6
|
+
}
|
|
7
|
+
export function formatBytes(bytes, digits = 2) {
|
|
8
|
+
if (bytes === 0)
|
|
9
|
+
return `${bytes.toFixed(digits)} B`;
|
|
10
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
11
|
+
const idx = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);
|
|
12
|
+
const value = bytes / Math.pow(1024, idx);
|
|
13
|
+
return `${value.toFixed(digits)} ${units[idx]}`;
|
|
14
|
+
}
|
|
15
|
+
export function formatUptime(seconds) {
|
|
16
|
+
if (seconds >= 86400) {
|
|
17
|
+
const days = Math.floor(seconds / 86400);
|
|
18
|
+
return `${days} day${days !== 1 ? 's' : ''}`;
|
|
19
|
+
}
|
|
20
|
+
if (seconds >= 3600) {
|
|
21
|
+
const hours = Math.floor(seconds / 3600);
|
|
22
|
+
return `${hours} hour${hours !== 1 ? 's' : ''}`;
|
|
23
|
+
}
|
|
24
|
+
if (seconds >= 60) {
|
|
25
|
+
const minutes = Math.floor(seconds / 60);
|
|
26
|
+
return `${minutes} minute${minutes !== 1 ? 's' : ''}`;
|
|
27
|
+
}
|
|
28
|
+
return `${seconds} second${seconds !== 1 ? 's' : ''}`;
|
|
29
|
+
}
|