edilkamin 1.10.0 → 1.10.2

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.
@@ -220,6 +220,17 @@ describe("library", () => {
220
220
  "getLanguage",
221
221
  "getPelletInReserve",
222
222
  "getPelletAutonomyTime",
223
+ // Statistics getters
224
+ "getTotalCounters",
225
+ "getServiceCounters",
226
+ "getAlarmHistory",
227
+ "getRegenerationData",
228
+ "getServiceTime",
229
+ // Analytics functions
230
+ "getTotalOperatingHours",
231
+ "getPowerDistribution",
232
+ "getServiceStatus",
233
+ "getUsageAnalytics",
223
234
  ];
224
235
  it("should create API methods with the correct baseURL", () => __awaiter(void 0, void 0, void 0, function* () {
225
236
  const baseURL = "https://example.com/api/";
@@ -791,6 +802,351 @@ describe("library", () => {
791
802
  assert_1.strict.equal(result, 240);
792
803
  }));
793
804
  });
805
+ describe("statistics getters", () => {
806
+ const mockDeviceInfoWithStats = {
807
+ status: {
808
+ commands: { power: true },
809
+ temperatures: { board: 25, enviroment: 20 },
810
+ flags: { is_pellet_in_reserve: false },
811
+ pellet: { autonomy_time: 900 },
812
+ counters: { service_time: 1108 },
813
+ },
814
+ nvm: {
815
+ user_parameters: {
816
+ language: 1,
817
+ is_auto: false,
818
+ is_fahrenheit: false,
819
+ is_sound_active: false,
820
+ enviroment_1_temperature: 19,
821
+ enviroment_2_temperature: 20,
822
+ enviroment_3_temperature: 20,
823
+ manual_power: 1,
824
+ fan_1_ventilation: 3,
825
+ fan_2_ventilation: 0,
826
+ fan_3_ventilation: 0,
827
+ is_standby_active: false,
828
+ standby_waiting_time: 60,
829
+ },
830
+ total_counters: {
831
+ power_ons: 278,
832
+ p1_working_time: 833,
833
+ p2_working_time: 15,
834
+ p3_working_time: 19,
835
+ p4_working_time: 8,
836
+ p5_working_time: 17,
837
+ },
838
+ service_counters: {
839
+ p1_working_time: 100,
840
+ p2_working_time: 10,
841
+ p3_working_time: 5,
842
+ p4_working_time: 2,
843
+ p5_working_time: 1,
844
+ },
845
+ alarms_log: {
846
+ number: 2,
847
+ index: 2,
848
+ alarms: [
849
+ { type: 3, timestamp: 1700000000 },
850
+ { type: 21, timestamp: 1700001000 },
851
+ ],
852
+ },
853
+ regeneration: {
854
+ time: 0,
855
+ last_intervention: 1577836800,
856
+ daylight_time_flag: 0,
857
+ blackout_counter: 43,
858
+ airkare_working_hours_counter: 0,
859
+ },
860
+ },
861
+ };
862
+ it("should get total counters", () => __awaiter(void 0, void 0, void 0, function* () {
863
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
864
+ const api = (0, library_1.configure)(constants_1.API_URL);
865
+ const result = yield api.getTotalCounters(expectedToken, "00:11:22:33:44:55");
866
+ assert_1.strict.deepEqual(result, mockDeviceInfoWithStats.nvm.total_counters);
867
+ }));
868
+ it("should get service counters", () => __awaiter(void 0, void 0, void 0, function* () {
869
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
870
+ const api = (0, library_1.configure)(constants_1.API_URL);
871
+ const result = yield api.getServiceCounters(expectedToken, "00:11:22:33:44:55");
872
+ assert_1.strict.deepEqual(result, mockDeviceInfoWithStats.nvm.service_counters);
873
+ }));
874
+ it("should get alarm history", () => __awaiter(void 0, void 0, void 0, function* () {
875
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
876
+ const api = (0, library_1.configure)(constants_1.API_URL);
877
+ const result = yield api.getAlarmHistory(expectedToken, "00:11:22:33:44:55");
878
+ assert_1.strict.deepEqual(result, mockDeviceInfoWithStats.nvm.alarms_log);
879
+ }));
880
+ it("should get regeneration data", () => __awaiter(void 0, void 0, void 0, function* () {
881
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
882
+ const api = (0, library_1.configure)(constants_1.API_URL);
883
+ const result = yield api.getRegenerationData(expectedToken, "00:11:22:33:44:55");
884
+ assert_1.strict.deepEqual(result, mockDeviceInfoWithStats.nvm.regeneration);
885
+ }));
886
+ it("should get service time", () => __awaiter(void 0, void 0, void 0, function* () {
887
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
888
+ const api = (0, library_1.configure)(constants_1.API_URL);
889
+ const result = yield api.getServiceTime(expectedToken, "00:11:22:33:44:55");
890
+ assert_1.strict.equal(result, 1108);
891
+ }));
892
+ });
893
+ describe("analytics functions", () => {
894
+ const mockDeviceInfoWithStats = {
895
+ status: {
896
+ commands: { power: true },
897
+ temperatures: { board: 25, enviroment: 20 },
898
+ flags: { is_pellet_in_reserve: false },
899
+ pellet: { autonomy_time: 900 },
900
+ counters: { service_time: 1108 },
901
+ },
902
+ nvm: {
903
+ user_parameters: {
904
+ language: 1,
905
+ is_auto: false,
906
+ is_fahrenheit: false,
907
+ is_sound_active: false,
908
+ enviroment_1_temperature: 19,
909
+ enviroment_2_temperature: 20,
910
+ enviroment_3_temperature: 20,
911
+ manual_power: 1,
912
+ fan_1_ventilation: 3,
913
+ fan_2_ventilation: 0,
914
+ fan_3_ventilation: 0,
915
+ is_standby_active: false,
916
+ standby_waiting_time: 60,
917
+ },
918
+ total_counters: {
919
+ power_ons: 278,
920
+ p1_working_time: 833,
921
+ p2_working_time: 15,
922
+ p3_working_time: 19,
923
+ p4_working_time: 8,
924
+ p5_working_time: 17,
925
+ },
926
+ service_counters: {
927
+ p1_working_time: 100,
928
+ p2_working_time: 10,
929
+ p3_working_time: 5,
930
+ p4_working_time: 2,
931
+ p5_working_time: 1,
932
+ },
933
+ alarms_log: {
934
+ number: 2,
935
+ index: 2,
936
+ alarms: [
937
+ { type: 3, timestamp: 1700000000 },
938
+ { type: 21, timestamp: 1700001000 },
939
+ ],
940
+ },
941
+ regeneration: {
942
+ time: 0,
943
+ last_intervention: 1577836800,
944
+ daylight_time_flag: 0,
945
+ blackout_counter: 43,
946
+ airkare_working_hours_counter: 0,
947
+ },
948
+ },
949
+ };
950
+ it("should calculate total operating hours", () => __awaiter(void 0, void 0, void 0, function* () {
951
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
952
+ const api = (0, library_1.configure)(constants_1.API_URL);
953
+ const result = yield api.getTotalOperatingHours(expectedToken, "00:11:22:33:44:55");
954
+ // 833 + 15 + 19 + 8 + 17 = 892
955
+ assert_1.strict.equal(result, 892);
956
+ }));
957
+ it("should calculate power distribution percentages", () => __awaiter(void 0, void 0, void 0, function* () {
958
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
959
+ const api = (0, library_1.configure)(constants_1.API_URL);
960
+ const result = yield api.getPowerDistribution(expectedToken, "00:11:22:33:44:55");
961
+ // Total: 892 hours
962
+ assert_1.strict.ok(result.p1 > 90); // 833/892 = 93.4%
963
+ assert_1.strict.ok(result.p2 < 5); // 15/892 = 1.7%
964
+ // Sum should be ~100%
965
+ const sum = result.p1 + result.p2 + result.p3 + result.p4 + result.p5;
966
+ assert_1.strict.ok(Math.abs(sum - 100) < 0.1);
967
+ }));
968
+ it("should handle zero operating hours in power distribution", () => __awaiter(void 0, void 0, void 0, function* () {
969
+ const zeroHoursInfo = Object.assign(Object.assign({}, mockDeviceInfoWithStats), { nvm: Object.assign(Object.assign({}, mockDeviceInfoWithStats.nvm), { total_counters: {
970
+ power_ons: 0,
971
+ p1_working_time: 0,
972
+ p2_working_time: 0,
973
+ p3_working_time: 0,
974
+ p4_working_time: 0,
975
+ p5_working_time: 0,
976
+ } }) });
977
+ fetchStub.resolves(mockResponse(zeroHoursInfo));
978
+ const api = (0, library_1.configure)(constants_1.API_URL);
979
+ const result = yield api.getPowerDistribution(expectedToken, "00:11:22:33:44:55");
980
+ assert_1.strict.deepEqual(result, { p1: 0, p2: 0, p3: 0, p4: 0, p5: 0 });
981
+ }));
982
+ it("should calculate service status", () => __awaiter(void 0, void 0, void 0, function* () {
983
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
984
+ const api = (0, library_1.configure)(constants_1.API_URL);
985
+ const result = yield api.getServiceStatus(expectedToken, "00:11:22:33:44:55");
986
+ assert_1.strict.equal(result.totalServiceHours, 1108);
987
+ // 100 + 10 + 5 + 2 + 1 = 118 hours since service
988
+ assert_1.strict.equal(result.hoursSinceService, 118);
989
+ assert_1.strict.equal(result.isServiceDue, false); // 118 < 2000
990
+ }));
991
+ it("should indicate service is due when threshold exceeded", () => __awaiter(void 0, void 0, void 0, function* () {
992
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
993
+ const api = (0, library_1.configure)(constants_1.API_URL);
994
+ // Use threshold of 100 hours
995
+ const result = yield api.getServiceStatus(expectedToken, "00:11:22:33:44:55", 100);
996
+ assert_1.strict.equal(result.isServiceDue, true); // 118 >= 100
997
+ }));
998
+ it("should get comprehensive usage analytics", () => __awaiter(void 0, void 0, void 0, function* () {
999
+ fetchStub.resolves(mockResponse(mockDeviceInfoWithStats));
1000
+ const api = (0, library_1.configure)(constants_1.API_URL);
1001
+ const result = yield api.getUsageAnalytics(expectedToken, "00:11:22:33:44:55");
1002
+ assert_1.strict.equal(result.totalPowerOns, 278);
1003
+ assert_1.strict.equal(result.totalOperatingHours, 892);
1004
+ assert_1.strict.equal(result.blackoutCount, 43);
1005
+ assert_1.strict.equal(result.alarmCount, 2);
1006
+ assert_1.strict.ok(result.lastMaintenanceDate instanceof Date);
1007
+ assert_1.strict.equal(result.serviceStatus.isServiceDue, false);
1008
+ }));
1009
+ it("should handle null lastMaintenanceDate when timestamp is 0", () => __awaiter(void 0, void 0, void 0, function* () {
1010
+ const noMaintenanceInfo = Object.assign(Object.assign({}, mockDeviceInfoWithStats), { nvm: Object.assign(Object.assign({}, mockDeviceInfoWithStats.nvm), { regeneration: Object.assign(Object.assign({}, mockDeviceInfoWithStats.nvm.regeneration), { last_intervention: 0 }) }) });
1011
+ fetchStub.resolves(mockResponse(noMaintenanceInfo));
1012
+ const api = (0, library_1.configure)(constants_1.API_URL);
1013
+ const result = yield api.getUsageAnalytics(expectedToken, "00:11:22:33:44:55");
1014
+ assert_1.strict.equal(result.lastMaintenanceDate, null);
1015
+ }));
1016
+ });
1017
+ describe("deriveUsageAnalytics", () => {
1018
+ const mockDeviceInfoForDerive = {
1019
+ status: {
1020
+ commands: {
1021
+ power: false,
1022
+ },
1023
+ temperatures: {
1024
+ enviroment: 20,
1025
+ set_air: 21,
1026
+ get_air: 20,
1027
+ set_water: 40,
1028
+ get_water: 35,
1029
+ },
1030
+ counters: {
1031
+ service_time: 1108,
1032
+ },
1033
+ flags: {
1034
+ is_pellet_in_reserve: false,
1035
+ },
1036
+ pellet: {
1037
+ autonomy_time: 180,
1038
+ },
1039
+ },
1040
+ nvm: {
1041
+ user_parameters: {
1042
+ language: 1,
1043
+ is_auto: false,
1044
+ is_fahrenheit: false,
1045
+ is_sound_active: false,
1046
+ enviroment_1_temperature: 19,
1047
+ enviroment_2_temperature: 20,
1048
+ enviroment_3_temperature: 20,
1049
+ manual_power: 1,
1050
+ fan_1_ventilation: 3,
1051
+ fan_2_ventilation: 0,
1052
+ fan_3_ventilation: 0,
1053
+ is_standby_active: false,
1054
+ standby_waiting_time: 60,
1055
+ },
1056
+ total_counters: {
1057
+ power_ons: 278,
1058
+ p1_working_time: 833,
1059
+ p2_working_time: 15,
1060
+ p3_working_time: 19,
1061
+ p4_working_time: 8,
1062
+ p5_working_time: 17,
1063
+ },
1064
+ service_counters: {
1065
+ p1_working_time: 100,
1066
+ p2_working_time: 10,
1067
+ p3_working_time: 5,
1068
+ p4_working_time: 2,
1069
+ p5_working_time: 1,
1070
+ },
1071
+ regeneration: {
1072
+ time: 0,
1073
+ last_intervention: 1577836800,
1074
+ daylight_time_flag: 0,
1075
+ blackout_counter: 43,
1076
+ airkare_working_hours_counter: 0,
1077
+ },
1078
+ alarms_log: {
1079
+ number: 6,
1080
+ index: 6,
1081
+ alarms: [],
1082
+ },
1083
+ },
1084
+ };
1085
+ it("should derive analytics from device info without API call", () => {
1086
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1087
+ const analytics = (0, library_1.deriveUsageAnalytics)(mockDeviceInfoForDerive);
1088
+ assert_1.strict.equal(analytics.totalPowerOns, 278);
1089
+ assert_1.strict.equal(analytics.totalOperatingHours, 892); // 833+15+19+8+17
1090
+ assert_1.strict.equal(analytics.blackoutCount, 43);
1091
+ assert_1.strict.equal(analytics.alarmCount, 6);
1092
+ });
1093
+ it("should calculate power distribution correctly", () => {
1094
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1095
+ const analytics = (0, library_1.deriveUsageAnalytics)(mockDeviceInfoForDerive);
1096
+ // P1: 833/892 ≈ 93.4%
1097
+ assert_1.strict.ok(analytics.powerDistribution.p1 > 93);
1098
+ assert_1.strict.ok(analytics.powerDistribution.p1 < 94);
1099
+ // Sum should be 100%
1100
+ const sum = Object.values(analytics.powerDistribution).reduce((a, b) => a + b, 0);
1101
+ assert_1.strict.ok(Math.abs(sum - 100) < 0.001);
1102
+ });
1103
+ it("should handle zero operating hours", () => {
1104
+ const zeroHoursInfo = Object.assign(Object.assign({}, mockDeviceInfoForDerive), { nvm: Object.assign(Object.assign({}, mockDeviceInfoForDerive.nvm), { total_counters: {
1105
+ power_ons: 0,
1106
+ p1_working_time: 0,
1107
+ p2_working_time: 0,
1108
+ p3_working_time: 0,
1109
+ p4_working_time: 0,
1110
+ p5_working_time: 0,
1111
+ } }) });
1112
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1113
+ const analytics = (0, library_1.deriveUsageAnalytics)(zeroHoursInfo);
1114
+ assert_1.strict.deepEqual(analytics.powerDistribution, {
1115
+ p1: 0,
1116
+ p2: 0,
1117
+ p3: 0,
1118
+ p4: 0,
1119
+ p5: 0,
1120
+ });
1121
+ });
1122
+ it("should respect custom service threshold", () => {
1123
+ const analytics = (0, library_1.deriveUsageAnalytics)(
1124
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1125
+ mockDeviceInfoForDerive, 100);
1126
+ // 118 hours since service >= 100 threshold
1127
+ assert_1.strict.equal(analytics.serviceStatus.isServiceDue, true);
1128
+ assert_1.strict.equal(analytics.serviceStatus.serviceThresholdHours, 100);
1129
+ });
1130
+ it("should use default threshold of 2000 hours", () => {
1131
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1132
+ const analytics = (0, library_1.deriveUsageAnalytics)(mockDeviceInfoForDerive);
1133
+ assert_1.strict.equal(analytics.serviceStatus.serviceThresholdHours, 2000);
1134
+ assert_1.strict.equal(analytics.serviceStatus.isServiceDue, false); // 118 < 2000
1135
+ });
1136
+ it("should convert last_intervention timestamp to Date", () => {
1137
+ var _a;
1138
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1139
+ const analytics = (0, library_1.deriveUsageAnalytics)(mockDeviceInfoForDerive);
1140
+ assert_1.strict.ok(analytics.lastMaintenanceDate instanceof Date);
1141
+ assert_1.strict.equal((_a = analytics.lastMaintenanceDate) === null || _a === void 0 ? void 0 : _a.getTime(), 1577836800 * 1000);
1142
+ });
1143
+ it("should return null for lastMaintenanceDate when timestamp is 0", () => {
1144
+ const noMaintenanceInfo = Object.assign(Object.assign({}, mockDeviceInfoForDerive), { nvm: Object.assign(Object.assign({}, mockDeviceInfoForDerive.nvm), { regeneration: Object.assign(Object.assign({}, mockDeviceInfoForDerive.nvm.regeneration), { last_intervention: 0 }) }) });
1145
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1146
+ const analytics = (0, library_1.deriveUsageAnalytics)(noMaintenanceInfo);
1147
+ assert_1.strict.equal(analytics.lastMaintenanceDate, null);
1148
+ });
1149
+ });
794
1150
  describe("Error Handling", () => {
795
1151
  const errorTests = [
796
1152
  { status: 400, statusText: "Bad Request" },
@@ -19,11 +19,18 @@ interface GeneralFlagsType {
19
19
  interface PelletAutonomyType {
20
20
  autonomy_time: number;
21
21
  }
22
+ /**
23
+ * Status counters including service time.
24
+ */
25
+ interface StatusCountersType {
26
+ service_time: number;
27
+ }
22
28
  interface StatusType {
23
29
  commands: CommandsType;
24
30
  temperatures: TemperaturesType;
25
31
  flags: GeneralFlagsType;
26
32
  pellet: PelletAutonomyType;
33
+ counters: StatusCountersType;
27
34
  }
28
35
  interface UserParametersType {
29
36
  enviroment_1_temperature: number;
@@ -40,10 +47,128 @@ interface UserParametersType {
40
47
  is_fahrenheit: boolean;
41
48
  language: number;
42
49
  }
50
+ /**
51
+ * Lifetime operating counters - never reset.
52
+ * Tracks total power-on cycles and runtime hours per power level.
53
+ */
54
+ interface TotalCountersType {
55
+ power_ons: number;
56
+ p1_working_time: number;
57
+ p2_working_time: number;
58
+ p3_working_time: number;
59
+ p4_working_time: number;
60
+ p5_working_time: number;
61
+ }
62
+ /**
63
+ * Service counters - reset after maintenance.
64
+ * Tracks runtime hours per power level since last service.
65
+ */
66
+ interface ServiceCountersType {
67
+ p1_working_time: number;
68
+ p2_working_time: number;
69
+ p3_working_time: number;
70
+ p4_working_time: number;
71
+ p5_working_time: number;
72
+ }
73
+ /**
74
+ * Individual alarm entry from the alarm history log.
75
+ */
76
+ interface AlarmEntryType {
77
+ type: number;
78
+ timestamp: number;
79
+ }
80
+ /**
81
+ * Alarm history log - circular buffer of recent alarms.
82
+ */
83
+ interface AlarmsLogType {
84
+ number: number;
85
+ index: number;
86
+ alarms: AlarmEntryType[];
87
+ }
88
+ /**
89
+ * Regeneration and maintenance tracking data.
90
+ */
91
+ interface RegenerationDataType {
92
+ time: number;
93
+ last_intervention: number;
94
+ daylight_time_flag: number;
95
+ blackout_counter: number;
96
+ airkare_working_hours_counter: number;
97
+ }
98
+ /**
99
+ * Power level distribution as percentages.
100
+ */
101
+ interface PowerDistributionType {
102
+ p1: number;
103
+ p2: number;
104
+ p3: number;
105
+ p4: number;
106
+ p5: number;
107
+ }
108
+ /**
109
+ * Service status with computed fields.
110
+ */
111
+ interface ServiceStatusType {
112
+ totalServiceHours: number;
113
+ hoursSinceService: number;
114
+ serviceThresholdHours: number;
115
+ isServiceDue: boolean;
116
+ }
117
+ /**
118
+ * Comprehensive usage analytics.
119
+ */
120
+ interface UsageAnalyticsType {
121
+ totalPowerOns: number;
122
+ totalOperatingHours: number;
123
+ powerDistribution: PowerDistributionType;
124
+ serviceStatus: ServiceStatusType;
125
+ blackoutCount: number;
126
+ lastMaintenanceDate: Date | null;
127
+ alarmCount: number;
128
+ }
129
+ /**
130
+ * Alarm type codes from Edilkamin devices.
131
+ * Based on AlarmsEnum.java from Android app (version 1.3.1-RC2 released 2025/12/10).
132
+ */
133
+ declare enum AlarmCode {
134
+ NONE = 0,
135
+ FLUE_BLOCK = 1,
136
+ SMOKE_EXTRACTOR_FAILURE = 2,
137
+ END_PELLET = 3,
138
+ MISSING_LIGHTING = 4,
139
+ NO_NAME_ALARM = 5,
140
+ SMOKE_PROBE_FAILURE = 6,
141
+ FUMES_OVERTEMPERATURE = 7,
142
+ PELLET_TANK_SAFETY_THERMOSTAT = 8,
143
+ GEAR_MOTOR_FAILURE = 9,
144
+ BOARD_OVER_TEMPERATURE = 10,
145
+ SAFETY_PRESSURE_SWITCH_INTERVENTION = 11,
146
+ ROOM_PROBE_FAILURE = 12,
147
+ ROOM_PROBE_2_OR_BOILER_PROBE_FAILURE = 13,
148
+ ROOM_PROBE_3_OR_BOILER_PROBE_FAILURE = 14,
149
+ WATER_EARTHQUAKE_SAFETY_THERMOSTAT_INTERVENTION = 15,
150
+ WATER_PRESSURE_TRANSDUCER_FAILURE = 16,
151
+ OUTSIDE_PROBE_OR_LOW_STORAGE_PROBE_FAILURE = 17,
152
+ PUFFER_PROBE_FAILURE = 18,
153
+ CRUCIBLE_CLEANING_FAILURE = 19,
154
+ TRIAC_FAILURE = 20,
155
+ BLACKOUT = 21,
156
+ OPEN_DOOR = 22,
157
+ OVERTEMPERATURE_PANEL = 23,
158
+ BOARD_FUSE = 24
159
+ }
160
+ /**
161
+ * Human-readable descriptions for alarm codes.
162
+ */
163
+ declare const AlarmDescriptions: Record<AlarmCode, string>;
43
164
  interface DeviceInfoType {
44
165
  status: StatusType;
45
166
  nvm: {
46
167
  user_parameters: UserParametersType;
168
+ total_counters: TotalCountersType;
169
+ service_counters: ServiceCountersType;
170
+ alarms_log: AlarmsLogType;
171
+ regeneration: RegenerationDataType;
47
172
  };
48
173
  }
49
174
  /**
@@ -99,4 +224,5 @@ interface DiscoveredDevice {
99
224
  /** Signal strength in dBm (optional, not all platforms provide this) */
100
225
  rssi?: number;
101
226
  }
102
- export type { BufferEncodedType, CommandsType, DeviceAssociationBody, DeviceAssociationResponse, DeviceInfoRawType, DeviceInfoType, DiscoveredDevice, EditDeviceAssociationBody, GeneralFlagsType, PelletAutonomyType, StatusType, TemperaturesType, UserParametersType, };
227
+ export type { AlarmEntryType, AlarmsLogType, BufferEncodedType, CommandsType, DeviceAssociationBody, DeviceAssociationResponse, DeviceInfoRawType, DeviceInfoType, DiscoveredDevice, EditDeviceAssociationBody, GeneralFlagsType, PelletAutonomyType, PowerDistributionType, RegenerationDataType, ServiceCountersType, ServiceStatusType, StatusCountersType, StatusType, TemperaturesType, TotalCountersType, UsageAnalyticsType, UserParametersType, };
228
+ export { AlarmCode, AlarmDescriptions };
@@ -1,2 +1,66 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlarmDescriptions = exports.AlarmCode = void 0;
4
+ /**
5
+ * Alarm type codes from Edilkamin devices.
6
+ * Based on AlarmsEnum.java from Android app (version 1.3.1-RC2 released 2025/12/10).
7
+ */
8
+ var AlarmCode;
9
+ (function (AlarmCode) {
10
+ AlarmCode[AlarmCode["NONE"] = 0] = "NONE";
11
+ AlarmCode[AlarmCode["FLUE_BLOCK"] = 1] = "FLUE_BLOCK";
12
+ AlarmCode[AlarmCode["SMOKE_EXTRACTOR_FAILURE"] = 2] = "SMOKE_EXTRACTOR_FAILURE";
13
+ AlarmCode[AlarmCode["END_PELLET"] = 3] = "END_PELLET";
14
+ AlarmCode[AlarmCode["MISSING_LIGHTING"] = 4] = "MISSING_LIGHTING";
15
+ AlarmCode[AlarmCode["NO_NAME_ALARM"] = 5] = "NO_NAME_ALARM";
16
+ AlarmCode[AlarmCode["SMOKE_PROBE_FAILURE"] = 6] = "SMOKE_PROBE_FAILURE";
17
+ AlarmCode[AlarmCode["FUMES_OVERTEMPERATURE"] = 7] = "FUMES_OVERTEMPERATURE";
18
+ AlarmCode[AlarmCode["PELLET_TANK_SAFETY_THERMOSTAT"] = 8] = "PELLET_TANK_SAFETY_THERMOSTAT";
19
+ AlarmCode[AlarmCode["GEAR_MOTOR_FAILURE"] = 9] = "GEAR_MOTOR_FAILURE";
20
+ AlarmCode[AlarmCode["BOARD_OVER_TEMPERATURE"] = 10] = "BOARD_OVER_TEMPERATURE";
21
+ AlarmCode[AlarmCode["SAFETY_PRESSURE_SWITCH_INTERVENTION"] = 11] = "SAFETY_PRESSURE_SWITCH_INTERVENTION";
22
+ AlarmCode[AlarmCode["ROOM_PROBE_FAILURE"] = 12] = "ROOM_PROBE_FAILURE";
23
+ AlarmCode[AlarmCode["ROOM_PROBE_2_OR_BOILER_PROBE_FAILURE"] = 13] = "ROOM_PROBE_2_OR_BOILER_PROBE_FAILURE";
24
+ AlarmCode[AlarmCode["ROOM_PROBE_3_OR_BOILER_PROBE_FAILURE"] = 14] = "ROOM_PROBE_3_OR_BOILER_PROBE_FAILURE";
25
+ AlarmCode[AlarmCode["WATER_EARTHQUAKE_SAFETY_THERMOSTAT_INTERVENTION"] = 15] = "WATER_EARTHQUAKE_SAFETY_THERMOSTAT_INTERVENTION";
26
+ AlarmCode[AlarmCode["WATER_PRESSURE_TRANSDUCER_FAILURE"] = 16] = "WATER_PRESSURE_TRANSDUCER_FAILURE";
27
+ AlarmCode[AlarmCode["OUTSIDE_PROBE_OR_LOW_STORAGE_PROBE_FAILURE"] = 17] = "OUTSIDE_PROBE_OR_LOW_STORAGE_PROBE_FAILURE";
28
+ AlarmCode[AlarmCode["PUFFER_PROBE_FAILURE"] = 18] = "PUFFER_PROBE_FAILURE";
29
+ AlarmCode[AlarmCode["CRUCIBLE_CLEANING_FAILURE"] = 19] = "CRUCIBLE_CLEANING_FAILURE";
30
+ AlarmCode[AlarmCode["TRIAC_FAILURE"] = 20] = "TRIAC_FAILURE";
31
+ AlarmCode[AlarmCode["BLACKOUT"] = 21] = "BLACKOUT";
32
+ AlarmCode[AlarmCode["OPEN_DOOR"] = 22] = "OPEN_DOOR";
33
+ AlarmCode[AlarmCode["OVERTEMPERATURE_PANEL"] = 23] = "OVERTEMPERATURE_PANEL";
34
+ AlarmCode[AlarmCode["BOARD_FUSE"] = 24] = "BOARD_FUSE";
35
+ })(AlarmCode || (exports.AlarmCode = AlarmCode = {}));
36
+ /**
37
+ * Human-readable descriptions for alarm codes.
38
+ */
39
+ const AlarmDescriptions = {
40
+ [AlarmCode.NONE]: "No alarm",
41
+ [AlarmCode.FLUE_BLOCK]: "Flue/chimney blockage",
42
+ [AlarmCode.SMOKE_EXTRACTOR_FAILURE]: "Smoke extractor motor failure",
43
+ [AlarmCode.END_PELLET]: "Pellet tank empty",
44
+ [AlarmCode.MISSING_LIGHTING]: "Ignition failure",
45
+ [AlarmCode.NO_NAME_ALARM]: "Unnamed alarm",
46
+ [AlarmCode.SMOKE_PROBE_FAILURE]: "Smoke temperature probe failure",
47
+ [AlarmCode.FUMES_OVERTEMPERATURE]: "Exhaust overtemperature",
48
+ [AlarmCode.PELLET_TANK_SAFETY_THERMOSTAT]: "Pellet tank safety thermostat triggered",
49
+ [AlarmCode.GEAR_MOTOR_FAILURE]: "Gear motor/auger failure",
50
+ [AlarmCode.BOARD_OVER_TEMPERATURE]: "Control board overtemperature",
51
+ [AlarmCode.SAFETY_PRESSURE_SWITCH_INTERVENTION]: "Safety pressure switch activated",
52
+ [AlarmCode.ROOM_PROBE_FAILURE]: "Room temperature probe failure",
53
+ [AlarmCode.ROOM_PROBE_2_OR_BOILER_PROBE_FAILURE]: "Room probe 2 or boiler probe failure",
54
+ [AlarmCode.ROOM_PROBE_3_OR_BOILER_PROBE_FAILURE]: "Room probe 3 or boiler probe failure",
55
+ [AlarmCode.WATER_EARTHQUAKE_SAFETY_THERMOSTAT_INTERVENTION]: "Water/earthquake safety thermostat",
56
+ [AlarmCode.WATER_PRESSURE_TRANSDUCER_FAILURE]: "Water pressure transducer failure",
57
+ [AlarmCode.OUTSIDE_PROBE_OR_LOW_STORAGE_PROBE_FAILURE]: "Outside probe or low storage probe failure",
58
+ [AlarmCode.PUFFER_PROBE_FAILURE]: "Buffer tank probe failure",
59
+ [AlarmCode.CRUCIBLE_CLEANING_FAILURE]: "Crucible cleaning failure",
60
+ [AlarmCode.TRIAC_FAILURE]: "Power control (TRIAC) failure",
61
+ [AlarmCode.BLACKOUT]: "Power outage detected",
62
+ [AlarmCode.OPEN_DOOR]: "Door open alarm",
63
+ [AlarmCode.OVERTEMPERATURE_PANEL]: "Panel overtemperature",
64
+ [AlarmCode.BOARD_FUSE]: "Control board fuse issue",
65
+ };
66
+ exports.AlarmDescriptions = AlarmDescriptions;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edilkamin",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "",
5
5
  "main": "dist/cjs/src/index.js",
6
6
  "module": "dist/esm/src/index.js",