modbus scan_interval: 0 is correct configuration#112619
Conversation
| if no_entities: | ||
| err = f"Modbus {hub[CONF_NAME]} is instable without entities, please add entities!" | ||
| _LOGGER.warning(err) | ||
| # Ensure timeout is not started/handled. | ||
| hub[CONF_TIMEOUT] = -1 |
There was a problem hiding this comment.
What would be a use case of adding a hub without adding entities?
There was a problem hiding this comment.
In a HA core only, none !
But there are a couple of custom components, who use a base modbus configuration, to add there own configuration on top...and thus use the modbus integration code instead of duplicating it (duplicating it gives nasty dependencies because both use the same library).
There was a problem hiding this comment.
But when custom components add entities, is it still unstable?
There was a problem hiding this comment.
No, it is only when running without entities....otherwise I would have issued an error and stopped the loading.
There was a problem hiding this comment.
Hang on, I made a mistake....the discussion we are having belong to PR #11618, and should not be here...
this one is just a single "if".
Sorry for the mistake, give me 2 seconds, and you will have a commit that correct this PR.
There was a problem hiding this comment.
@joostlek updated to be correct....when I created the branch, I forgot to start from dev :-( my mistake.
Breaking change
Proposed change
When scan_interval < 5 a warning is issued, that it may cause stability issues, however 0 is allowed for read-once entities.
Type of change
Additional information
fixes Modbus: scan_interval:0 detected as invalid #112616
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: