Skip to content

feat: add update frequency and operation mode parameters to MQTT client - #10

Merged
AndyTempel merged 2 commits into
mainfrom
feat-more-params
Jan 17, 2026
Merged

feat: add update frequency and operation mode parameters to MQTT client#10
AndyTempel merged 2 commits into
mainfrom
feat-more-params

Conversation

@AndyTempel

Copy link
Copy Markdown
Member

This pull request adds support for configuring the MQTT client's update frequency and operation mode when creating a VRM MQTT client, providing more flexibility for users of the library. The changes also ensure that the update frequency is safely bounded between 0 and 300 seconds.

MQTT Client Configuration Enhancements

  • Added update_frequency and operation_mode parameters to both the VRMMQTTClient constructor and the get_mqtt_client_for_installation method in client.py, allowing callers to specify how often updates are received and the operational mode of the MQTT client. [1] [2]
  • Ensured the update_frequency value is clamped between 0 and 300 seconds for safety and reliability.
  • Updated imports in client.py and mqtt.py to include the new OperationMode type from victron_mqtt, supporting the new parameter. [1] [2]
  • Passed the new parameters (update_frequency_seconds and operation_mode) to the base VictronMQTTHub class in VRMMQTTClient, ensuring the configuration is applied at the hub level.

Copilot AI review requested due to automatic review settings January 17, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for configuring MQTT client update frequency and operation mode when creating a VRM MQTT client. The implementation adds new parameters to both the VRMMQTTClient class and the get_mqtt_client_for_installation method, with safety bounds for update frequency (0-300 seconds).

Changes:

  • Added update_frequency and operation_mode parameters to VRMMQTTClient.__init__ with validation logic
  • Updated get_mqtt_client_for_installation method signature to accept these parameters
  • Imported OperationMode from victron_mqtt in both files

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
victron_vrm/mqtt.py Added new parameters to VRMMQTTClient constructor with update_frequency clamping logic and passed them to parent VictronMQTTHub class
victron_vrm/client.py Added import for OperationMode and updated get_mqtt_client_for_installation method signature with new parameters and documentation

Comment thread victron_vrm/mqtt.py
Comment thread victron_vrm/mqtt.py Outdated
Comment thread victron_vrm/client.py
Comment thread victron_vrm/client.py
@AndyTempel
AndyTempel merged commit 9a7b0bd into main Jan 17, 2026
10 checks passed
@AndyTempel
AndyTempel deleted the feat-more-params branch January 17, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants