skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
94 stars 15 forks source link

Polling interval is in seconds while configuration windows says it is in minutes #215

Closed fursov closed 3 weeks ago

fursov commented 3 weeks ago

Describe the bug The polling interval seems to be in seconds while confiuration window says minutes

Debug logs

2024-11-08 13:40:17.122 DEBUG (MainThread) [custom_components.myskoda.coordinator] Performing scheduled update of all data for vin TMBAWXXXXXXXX
2024-11-08 13:40:19.781 DEBUG (MainThread) [myskoda.mqtt] Sending PINGREQ
2024-11-08 13:40:19.810 DEBUG (MainThread) [myskoda.mqtt] Received PINGRESP
2024-11-08 13:40:20.175 DEBUG (MainThread) [myskoda.mqtt] Sending PINGREQ
2024-11-08 13:40:20.204 DEBUG (MainThread) [myskoda.mqtt] Received PINGRESP
2024-11-08 13:40:28.408 DEBUG (MainThread) [custom_components.myskoda.coordinator] Finished fetching myskoda data in 11.286 seconds (success: True)
2024-11-08 13:40:33.123 DEBUG (MainThread) [custom_components.myskoda.coordinator] Performing scheduled update of all data for vin TMBAWXXXXXXXX
2024-11-08 13:40:34.801 DEBUG (MainThread) [myskoda.mqtt] Sending PINGREQ
2024-11-08 13:40:34.832 DEBUG (MainThread) [myskoda.mqtt] Received PINGRESP
2024-11-08 13:40:35.184 DEBUG (MainThread) [myskoda.mqtt] Sending PINGREQ
2024-11-08 13:40:35.213 DEBUG (MainThread) [myskoda.mqtt] Received PINGRESP
2024-11-08 13:40:44.122 DEBUG (MainThread) [custom_components.myskoda.coordinator] Finished fetching myskoda data in 10.999 seconds (success: True)
2024-11-08 13:40:49.123 DEBUG (MainThread) [custom_components.myskoda.coordinator] Performing scheduled update of all data for vin TMBAWXXXXXXXX
2024-11-08 13:40:49.819 DEBUG (MainThread) [myskoda.mqtt] Sending PINGREQ
2024-11-08 13:40:49.847 DEBUG (MainThread) [myskoda.mqtt] Received PINGRESP
2024-11-08 13:40:50.198 DEBUG (MainThread) [myskoda.mqtt] Sending PINGREQ
2024-11-08 13:40:50.226 DEBUG (MainThread) [myskoda.mqtt] Received PINGRESP

Additional context Release 1.8.0

WebSpider commented 3 weeks ago

Oh!

It was in seconds initially, then i converted it to minutes. Must have missed it somewhere. Thanks.

dvx76 commented 3 weeks ago

@WebSpider user setting is in minutes but the default is in seconds. The coordinator expects seconds.

            update_interval=timedelta(
                seconds=config.options.get(
                    CONF_POLL_INTERVAL, DEFAULT_FETCH_INTERVAL_IN_MINUTES
                )
            ),

Rather than converting things my preference would be to define everything in seconds. So change the user input config item to expect seconds. Once people start using it and have values in their config it's harder to change.