net-daemon / netdaemon

An application daemon for Home Assistant written in .NET
MIT License
223 stars 64 forks source link

Add converter to make sure we have a string value when expect it #1126

Closed helto4real closed 4 months ago

helto4real commented 4 months ago

Breaking change

Proposed change

Add converters that returns null if expected string value is not a string when deserializing devices or the string if it is a valid string.

Type of change

Additional information

Checklist

If user exposed functionality or configuration are added/changed:

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81%. Comparing base (7f9914e) to head (9fb54cc).

Files Patch % Lines
....HassClient/Internal/Json/EnsureStringConverter.cs 60% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1126 +/- ## ==================================== - Coverage 81% 81% -1% ==================================== Files 189 190 +1 Lines 3838 3843 +5 Branches 460 462 +2 ==================================== + Hits 3141 3144 +3 - Misses 517 518 +1 - Partials 180 181 +1 ``` | [Flag](https://app.codecov.io/gh/net-daemon/netdaemon/pull/1126/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=net-daemon) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/net-daemon/netdaemon/pull/1126/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=net-daemon) | `81% <60%> (-1%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=net-daemon#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.