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

Draft NumericSensors #539

Merged
merged 7 commits into from
Dec 6, 2021
Merged

Conversation

FrankBakkerNl
Copy link
Contributor

@FrankBakkerNl FrankBakkerNl commented Nov 30, 2021

Breaking change

The code generator will now generate NumericSensorEntities for all Sensors that have a 'unit_of_measurement'attribute instead of a normal SensorEntity. InputNumbersEntity is now also derived from NumericEntity

Proposed change

Improved Numeric Entities to also have Numeric values in StateChange Observables. The code generator now also generates some Entities as Numeric

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]
  • The code compiles without warnings (code quality chek)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2021

Codecov Report

Merging #539 (b98d8b8) into dev (f0f7600) will increase coverage by 0.03%.
The diff coverage is 90.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #539      +/-   ##
==========================================
+ Coverage   59.69%   59.73%   +0.03%     
==========================================
  Files         139      139              
  Lines        5856     5869      +13     
  Branches      843      846       +3     
==========================================
+ Hits         3496     3506      +10     
  Misses       2076     2076              
- Partials      284      287       +3     
Flag Coverage Δ
unittests 59.73% <90.27%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
...on.HassModel.CodeGenerator/Helpers/NamingHelper.cs 90.69% <ø> (-0.80%) ⬇️
...sModel/NetDeamon.HassModel/Entities/EntityState.cs 84.61% <0.00%> (-7.06%) ⬇️
...NetDeamon.HassModel/Entities/NumericEntityState.cs 50.00% <33.33%> (-10.00%) ⬇️
...odel/NetDeamon.HassModel/Entities/NumericEntity.cs 42.85% <50.00%> (+17.85%) ⬆️
...mon.HassModel.CodeGenerator/Generator.Entitites.cs 96.09% <97.87%> (+0.47%) ⬆️
...c/HassModel/NetDeamon.HassModel/Entities/Entity.cs 80.00% <100.00%> (+11.42%) ⬆️
...l/NetDeamon.HassModel/Entities/EntityExtensions.cs 44.44% <100.00%> (ø)
...sModel/NetDeamon.HassModel/Entities/StateChange.cs 100.00% <100.00%> (ø)
....App/Common/Reactive/ObservableExtensionMethods.cs 52.17% <0.00%> (-13.05%) ⬇️
... and 2 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 f0f7600...b98d8b8. Read the comment docs.

@FrankBakkerNl FrankBakkerNl marked this pull request as ready for review December 4, 2021 14:48
@helto4real
Copy link
Collaborator

I think it looks good. Will this be breaking? Will the new entities be numeric and maybe some code uses string and do conversion them self?

@FrankBakkerNl FrankBakkerNl merged commit 2544e38 into net-daemon:dev Dec 6, 2021
@FrankBakkerNl FrankBakkerNl deleted the NumericSensors branch December 6, 2021 18:13
Ikcelaks pushed a commit to Ikcelaks/netdaemon that referenced this pull request Dec 23, 2022
* Draft NumericSensors

* Working?

* Some cleanup + fix tests

* Fix warnings

* Improve coverage

* Fix small comment and did some more cleanup

Co-authored-by: Tomas Hellström <tomas.hellstrom@yahoo.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants