Closed gauthierm closed 3 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/services/zone-group-topology.service.ts | 0 | 5 | 0.0% | ||
<!-- | Total: | 0 | 5 | 0.0% | --> |
Totals | |
---|---|
Change from base Build 426734931: | -0.1% |
Covered Lines: | 856 |
Relevant Lines: | 1421 |
I’m all for parsing this information!!
But as stated in the top of this file, this file is generated and will be regenerated when the documentation changes.
your changes will be lost when I would regenerate the auto-generated part of this library. I moved the soap documentation, the generator and the template files to https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs/templates/ts
So I will accept this PR (so you become a contributor) if you also make a PR for this file.
Ah thanks. I didn't realize the file was generated. I will update the PR to move the change to the template. I'm considering unit tests for the new method. Where should tests live?
It seems like a really difficult way to develop the service to generate the TypeScript code with a template. You lose all type checking, linting, testing, code formatting, etc during development. Could the amount of templated code be reduced and all the custom methods and parsers moved to the main project in real TypeScript?
From an outside contributor's perspective, having all the separate service classes mashed into a single template makes it really hard to understand.
I totally agree that the service extensions are not really nice implemented, I'm open to suggestions.
I do like the fact that 90% of the code in those services is actually generated and that generating them from the service discovery costs only a few seconds.
I was thinking about creating the extensions in separate files in the services folder but that makes generating the index harder. Also the SonosDeviceBase is generated and should be changed to import the correct service.
Sorry about the extra work! Since the extensions are now splitted to separate files I cannot merge this PR anymore. So will be closing it.
I've re-created your work here and would like to ask you to add your (anonymized) ZoneGroupState to the tests. See this comment
Adds information about stereo pairs to the parsed group information
After this change, the zone group is parsed as: