Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow alternative services to be selected #458

Merged
merged 7 commits into from
Jun 27, 2022
Merged

Conversation

itavero
Copy link
Owner

@itavero itavero commented Jun 14, 2022

Trying out some things on this branch to allow for configuration that is specific to a converter, which would allow users to configure certain converters to behave differently (i.e. expose a different services, like an Outlet instead of a Switch).
Hopefully in the end this will provide a solution for #45, #279, #380, #422 and possibly other issues/requests I'm forgetting here.

No promises yet, as I still feel this approach requires some polishing.

Definitely still to do:

  • Update changelog.
  • Allow Occupancy sensor to use Motion Sensor service instead.
  • Add tests for "Occupancy Sensor as Motion Sensor"
  • Write documentation.
  • Integrate this into the configuration model for Config UI X
  • Try to improve usability of settings screen in Config UI X (it has become quite a mess)
  • Make sure the "service configuration" in a device specific configuration is merged correctly with the default device configuration.
  • Come up with a better name for "service configuration" (perhaps "converter configuration" is better, as I think the "converters" are actually also called "converters" in the docs already).
  • More testing?
  • Additional refactoring in basic_sensors.ts (information about the properties should be in the class that handles it rather than in the "creator collection")
  • Other things I forgot when making this list 😅

@itavero itavero self-assigned this Jun 14, 2022
@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #458 (88bf0c9) into master (223f2aa) will increase coverage by 2.94%.
The diff coverage is 77.06%.

@@            Coverage Diff             @@
##           master     #458      +/-   ##
==========================================
+ Coverage   50.36%   53.30%   +2.94%     
==========================================
  Files          23       36      +13     
  Lines        1938     2088     +150     
  Branches      509      534      +25     
==========================================
+ Hits          976     1113     +137     
+ Misses        509      507       -2     
- Partials      453      468      +15     
Flag Coverage Δ
tests 53.30% <77.06%> (+2.94%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/platform.ts 0.00% <0.00%> (ø)
src/platformAccessory.ts 0.00% <0.00%> (ø)
src/configModels.ts 37.83% <38.09%> (+37.83%) ⬆️
src/converters/switch.ts 74.50% <70.00%> (-4.98%) ⬇️
src/converters/basic_sensors/basic.ts 72.72% <72.72%> (ø)
src/converters/creators.ts 81.81% <75.00%> (-7.66%) ⬇️
src/converters/basic_sensors/occupancy.ts 77.27% <77.27%> (ø)
src/converters/basic_sensors/carbon_monoxide.ts 80.00% <80.00%> (ø)
src/converters/basic_sensors/contact.ts 80.00% <80.00%> (ø)
src/converters/basic_sensors/presence.ts 80.00% <80.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 223f2aa...88bf0c9. Read the comment docs.

@itavero itavero changed the title Work in progress: Allow alternative services to be selected Allow alternative services to be selected Jun 26, 2022
@github-actions
Copy link
Contributor

🆗 Published SonarCloud and code coverage data.

@sonarcloud
Copy link

sonarcloud bot commented Jun 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

82.6% 82.6% Coverage
0.0% 0.0% Duplication

@itavero itavero merged commit 9b833c7 into master Jun 27, 2022
@itavero itavero mentioned this pull request Jul 26, 2022
4 tasks
@itavero itavero deleted the allow_alternative_services branch October 1, 2022 01:01
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.

None yet

1 participant