edilkamin 1.6.1 → 1.6.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.
package/src/types.ts CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Represents a Node.js Buffer object serialized to JSON.
3
+ * This format is used by the Edilkamin API for gzip-compressed fields.
4
+ */
5
+ interface BufferEncodedType {
6
+ type: "Buffer";
7
+ data: number[];
8
+ }
9
+
1
10
  interface CommandsType {
2
11
  power: boolean;
3
12
  }
@@ -27,9 +36,60 @@ interface DeviceInfoType {
27
36
  };
28
37
  }
29
38
 
39
+ /**
40
+ * Raw device info response that may contain Buffer-encoded compressed fields.
41
+ * Used internally before processing; external callers receive DeviceInfoType.
42
+ */
43
+ interface DeviceInfoRawType {
44
+ status: StatusType | BufferEncodedType;
45
+ nvm:
46
+ | {
47
+ user_parameters: UserParametersType;
48
+ }
49
+ | BufferEncodedType;
50
+ component_info?: BufferEncodedType | Record<string, unknown>;
51
+ }
52
+
53
+ /**
54
+ * Request body for registering a device with a user account.
55
+ * All fields are required by the API.
56
+ */
57
+ interface DeviceAssociationBody {
58
+ macAddress: string;
59
+ deviceName: string;
60
+ deviceRoom: string;
61
+ serialNumber: string;
62
+ }
63
+
64
+ /**
65
+ * Request body for editing a device's name and room.
66
+ * MAC address is specified in the URL path, not the body.
67
+ * Serial number cannot be changed after registration.
68
+ */
69
+ interface EditDeviceAssociationBody {
70
+ deviceName: string;
71
+ deviceRoom: string;
72
+ }
73
+
74
+ /**
75
+ * Response from device registration endpoint.
76
+ * Structure based on Android app behavior - may need adjustment after testing.
77
+ */
78
+ interface DeviceAssociationResponse {
79
+ macAddress: string;
80
+ deviceName: string;
81
+ deviceRoom: string;
82
+ serialNumber: string;
83
+ }
84
+
30
85
  export type {
86
+ BufferEncodedType,
31
87
  CommandsType,
88
+ DeviceAssociationBody,
89
+ DeviceAssociationResponse,
90
+ DeviceInfoRawType,
32
91
  DeviceInfoType,
92
+ EditDeviceAssociationBody,
33
93
  StatusType,
34
94
  TemperaturesType,
35
95
  UserParametersType,