Skip to content

m.poll() triggers duplicate poll calls when interval changes #10520

@sbraz

Description

@sbraz

Hi again @Koenkk,
I think I found a generic issue with the poll function.

To reproduce, here's what I do with the ZLinky:

Logs now show two poll instances running at once:

[2025-10-25 22:31:49] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:02] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:32:06] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:11] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:32:13] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:19] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:32:21] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:27] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:32:28] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:35] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:36] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:32:43] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:44] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:32:50] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:32:52] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:32:58] info:     zhc:lixee: Running poll with interval 7
[2025-10-25 22:33:01] info:     zhc:lixee: Running poll with interval 8
[2025-10-25 22:33:05] info:     zhc:lixee: Running poll with interval 7

My locally-applied patch:

@@ -1830,6 +1830,7 @@
                     "The default poll interval for these is 600 seconds. Set to -1 to disable polling. " +
                     "Polled attributes are those marked as read-only at https://github.com/fairecasoimeme/Zlinky_TIC/"),
                 poll: async (device, options) => {
+                    logger_1.logger.info(`Running poll with interval ${options.measurement_poll_interval}`, NS);
                     const endpoint = device.getEndpoint(1);
                     const measurement_poll_chunk = options?.measurement_poll_chunk ? options.measurement_poll_chunk : 4;
                     utils.assertNumber(measurement_poll_chunk);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions