Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add state dependent icons to moon sensor #28743
Material design icons have icons for all sensor.states, let's use these natively in the component.
Related issue (if applicable): fixes #
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for
it errors out on an unaltered line, that has been there before my effort:
now what. Really sorry, but I am afraid without reasonable instructions how to setup a local PR-test configuration this is all a bit too much for me...
thanks, I am working without one. Read the page before, and, using a Mac, installed home-brew, but after that, well, gave up really. Hence my effort to test the file in black locally.
@Mariusthvdb The test coverage of this integration is not up to par, because you've added a couple of lines of code, which could also be tested.
Could you add a couple of tests to improve its coverage? That would be awesome!
having said that, I will certainly have a look if I can add a test, I take it for the icon? Whole new territory and code-language for me, so not sure yet ;-)
ok, trying to KISS, and build on what's already there, could this be a way to go?:
if so, Ill add it to the other test also.
Hmm.. looking at it, you've actually increased the coverage with 2.66%. So it's fine I guess.
The main issue (looking at codecov), is not the icons, but the other moon phases not being tested.
Considering that, this is all out of scope for this PR. So let's go ahead and merge this in.
If you are up for a little challenge and want to learn more about testing, I can definitely recommend this integration, since it is fairly simple and a good starter, with already some tests in place that simply need to be extended.