davidusb-geek / emhass

emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant.
MIT License
284 stars 54 forks source link

Make options optional #158

Closed GeoDerp closed 8 months ago

GeoDerp commented 8 months ago

Home assistant optional parameters support

GeoDerp commented 8 months ago

@davidusb-geek sorry was developing this and saw all you done with the pull requests. I think this code could be necessary for the emhass-add-on https://github.com/davidusb-geek/emhass-add-on/pull/69

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (4a6b492) 89.40% compared to head (8e447d9) 89.40%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #158 +/- ## ======================================= Coverage 89.40% 89.40% ======================================= Files 6 6 Lines 1491 1491 ======================================= Hits 1333 1333 Misses 158 158 ```

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

GeoDerp commented 8 months ago

@davidusb-geek sorry about that. I hope this all gets to you in time.

GeoDerp commented 8 months ago

About my last commit. Got pytest tab inside of vscode working (inside of the vs-code virtual environment). There is also now a vs-code task to compile emhass, and two launch commands to debug emhass with and without add-on. Add-on launch requires key and url inserted in the launch.json to operate however. Hope it helps.

davidusb-geek commented 8 months ago

Ok merging and then testing this locally. I did tried the new launch.json but I did not understand how to launch a specific cofiguration inside the launch.json. Do you know how to do this?

davidusb-geek commented 8 months ago

Ok merging and then testing this locally. I did tried the new launch.json but I did not understand how to launch a specific cofiguration inside the launch.json. Do you know how to do this?

Well don't about this I just found how to select the configuration that I want to run. It's in the debug pane to the left on VScode Well explained here: https://gigi.nullneuron.net/gigilabs/working-with-vs-code-launch-configurations/

GeoDerp commented 8 months ago

The thought would be that someone would pull the code, run it in vscode Dev container. (After vs code asks on the bottom right) Press ctrl+ship+p, select run task, select build emhass

Then on the left tab as you mentioned run the desired launch function and have the gui give out the results. The variable section when it fails is my favourite part.

Also the pytest panel (I believe ok the left tab below) should also work now too.

I'll have a read of that link today. 👍