MCPcopy Create free account
hub / github.com/bytespider/Meross / fetchDeviceInfo

Method fetchDeviceInfo

packages/lib/src/device.ts:128–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126 }
127
128 async fetchDeviceInfo() {
129 deviceLogger.info(`Fetching device information for ${this.id}`);
130 const message = new QueryDeviceInformationMessage();
131 const {
132 payload: { all },
133 } = await this.sendMessage(message);
134
135 const {
136 system: { firmware = FirmwareDefaults, hardware = HardwareDefaults },
137 } = all;
138
139 this.model = hardware?.type;
140 deviceLogger.info(
141 `Device Info - Model: ${this.model}, Firmware: ${firmware?.version}, Hardware: ${hardware?.version}, UUID: ${hardware?.uuid}, MAC Address: ${hardware?.macAddress}`
142 );
143
144 this.firmware = {
145 version: firmware?.version,
146 compileTime: firmware?.compileTime
147 ? new Date(firmware?.compileTime)
148 : undefined,
149 };
150
151 this.hardware = {
152 version: hardware?.version,
153 uuid: hardware?.uuid,
154 macAddress: hardware?.macAddress,
155 };
156
157 return all;
158 }
159
160 async fetchDeviceAbilities() {
161 deviceLogger.info(`Fetching device abilities for ${this.id}`);

Callers 3

fetchDeviceInfoFunction · 0.80
meross-setup.tsFile · 0.80
meross-info.tsFile · 0.80

Calls 1

sendMessageMethod · 0.95

Tested by

no test coverage detected