Skip to content

Commit

Permalink
fix(ignore): fix 6b3911a
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Mar 21, 2024
1 parent 634046f commit 4d0dc21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export async function onEvent(type: OnEventType, data: OnEventData, device: Zh.D
const oneJanuary2000 = new Date('January 01, 2000 00:00:00 UTC+00:00').getTime();
const secondsUTC = Math.round(((new Date()).getTime() - oneJanuary2000) / 1000);
const secondsLocal = secondsUTC - (new Date()).getTimezoneOffset() * 60;
device.getEndpoint(1).readResponse('genTime', data.meta.zclTransactionSequenceNumber, {time: secondsLocal}).catch((e) => {
endpoint.readResponse('genTime', frame.Header.transactionSequenceNumber, {time: secondsLocal}).catch((e) => {
logger.logger.warn(`ZNCWWSQ01LM custom time response failed: ${e}`);
})
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/modernExtend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ export function customTimeResponse(start: '1970_UTC' | '2000_LOCAL'): ModernExte
const secondsUTC = Math.round(((new Date()).getTime() - oneJanuary2000) / 1000);
payload.time = secondsUTC - (new Date()).getTimezoneOffset() * 60;
}
data.endpoint.readResponse('genTime', data.meta.zclTransactionSequenceNumber, payload).catch((e) => {
endpoint.readResponse('genTime', frame.Header.transactionSequenceNumber, payload).catch((e) => {
logger.logger.warn(`Custom time response failed for '${device.ieeeAddr}': ${e}`);
});
return true;
Expand Down

0 comments on commit 4d0dc21

Please sign in to comment.