------
Backwards-incompatible changes:
* ``initial-state`` can no longer be `salobj.State.FAULT` when constructing a CSC.
This may break some unit tests.
Changes:
* Gets its configuration from the new ``ts_ddsconfig`` package.
* Improved support for specifying the initial state of the CSC:
* Add ``enable_cmdline_state`` class variable, which defaults to False.
If True then `BaseCsc.amain` adds ``--state`` and (if relevant) ``--settings`` command-line argument`.
* Added constructor argument ``settings_to_apply`` to `BaseCsc` and `ConfigurableCsc`.
If you have a configurable CSC then you should add this parameter to your constructor.
* CSCs now handle ``initial_state`` differently: the CSC starts in the default initial state
and `BaseCsc.start` transitions to each intermediate state in turn.
* As a result, ``initial_state`` can no longer be `State.FAULT`.
* Added function `get_expected_summary_states`.
* Improved `BaseCsc.amain` to accept an `enum.IntEnum` as the value of the index parameter.
This restricts the allowed values and describes each value in the help.
* Improved `BaseCscTestCase.assert_next_sample` to try to cast read SAL values to the apppropriate enum,
if the expected value is an instance of `enum.IntEnum`.
This makes errors easier to understand.
* Improved `Controller` startup: commands will be ignored until the `Controller` has (at least mostly) started.
This avoids mysterious errors from commanding a partially constructed SAL component.
* Improved the output of `BaseCscTestCase` if the subprocess dies.
* Uses ``pre-commit`` instead of a custom git pre-commit hook.
You may have to do the following to take advantage of it:
* Run `pre-commit install` once.
* If directed, run `git config --unset-all core.hooksPath` once.
How to update your Code. Except as noted, all changes are backwards compatible with ts_salobj 6.0:
* If your CSC overrides the `BaseCsc.start` method, make sure it calls ``await super().start()``
at or near the *end* of your ``start`` method, not the beginning.
This is because `BaseCsc.start()` can now call state transition commands,
which will trigger calls to `BaseCsc.handle_summary_state`;
thus your CSC should be as "started" as practical before calling ``await super().start()``.
* If you wish to be able to specify the initial state of your CSC from the command line:
* Set class variable ``enable_cmdline_state`` to True.
* If your CSC is configurable and does not have a usable default configuration
(so it *must* have settings specified in the ``start`` command)
specify class variable ``settings_required = True``.
This is rare, but Watcher is one such CSC.
* If you have a configurable CSC, add constructor argument ``settings_to_apply=""`` and pass it (by name) to ``super().__init__``.
This is essential if you set ``enable_cmdline_state = True``, and useful for unit tests even if not.
This change is *not* backwards compatible with ts_salobj 6.0.
* If your CSC is "externally commandable" (it does not quit in OFFLINE state)
specify class variable ``default_initial_state = salobj.State.OFFLINE``.
Requirements:
* ts_ddsconfig
* ts_idl 2
* ts_xml 6.1 (older versions might work but have not been tested)
* IDL files for Test, Script, and LOVE generated by ts_sal 5
* SALPY_Test generated by ts_sal 5