-
Notifications
You must be signed in to change notification settings - Fork 130
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
New scheduling code, WeatherNOAA fixes, and documentation updates for DOORBIRD.pm and HARMON.pm. #629
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes, a few cleanups needed.
But more generally this is not a really proper way to send a review, you're sending us changes, then reverts, and then more changes on top, making the review very hard.
More generally, there are 3 different changes totally unrelated, in this CL.
I realize it's a bit of a pain from your side, but the normal way is to make a branch for each change and send one combined change (no multiple changes and reverts and more patches) in each pull.
Now I realize this may be a lot of work here.
If it's prohibitive, try to clean up your current change and collapse it as one diff, and I'll try and do a review of all 3, even if they are unrelated and shouldn't be combined in one pull, but please avoid this in the future.
In the meantime, I manually merged just your weather changes to my tree and will see if they fix my problems too. Thanks again for those.
|
||
# Dang ... a 'do pgm' can only return a scalar, not a list :( | ||
if ( $data{conditions} ) { | ||
# Dang ... a 'do pgm' can only return a scalar, not a list :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting broken
if ( $data{conditions} ) { | ||
print "\nCurrent conditions: $conditions\n"; | ||
if ($data{conditions}) { | ||
#print "\nCurrent conditions: $conditions\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this commented out?
# RICK 160817 | ||
#print "Getting the forecast for $parms{zone}, $parms{state}\n"; | ||
print "Getting the forecast for $parms{city}, $parms{state}, $parms{zone}\n"; | ||
#$forecast = print_forecast($parms{zone}, $parms{state},undef,undef,undef,1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete commented code
$forecast =~ s/Geo::WeatherNOAA.pm .+\n//; # Drop geo version | ||
#$forecast =~ s/\.\.\./\. /g; | ||
if ($data{forecast}) { | ||
# RICK 160817 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete
print_current( $parms{city}, $parms{state}, undef, undef, undef, 1 ); | ||
if ($data{conditions}) { | ||
# Rick 160816 | ||
#print "\nGetting the current weather for $parms{city}, $parms{state}\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete commented lines
my %config_parms; | ||
|
||
$parms{city} = 'Rochester' unless $parms{city}; | ||
$parms{zone} = $parms{city} unless $parms{zone}; | ||
#RICK 160817 | ||
#$parms{zone} = $parms{city} unless $parms{zone}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete commented lines
@hollie could you also confirm that the diffs look all bad (lots of unchanged code with simply formatting changes) because @waynieack didn't run a perl reformatter on his changes, or is it another problem? |
@waynieack I tried to install just your fixes to weather in my tree: but I still don't seem to be getting weather with this, am I supposed to change the way I call it? Getting the current weather for SAN JOSE, CA, SAN JOSE |
@waynieack first of all thanks for this pull request! As @marcmerlin mentions: normally it is indeed the idea to split up different fixes or adaptations into different pull requests because this makes the code easier to review. You can do this by making a new branch in your working copy, as described here: https://github.com/hollie/misterhouse/wiki/Contributing#developing-using-git Then a general remark: you don't have to comment out lines and add your name in front. Since we're using git we know exactly who is responsible for a specific code change ;-) There are indeed a few changes that are only related to whitespaces that are changed. Did you run a specific formatter on the code to do that? We have a specific set of Perltidy settings that we use to format the code in this project. For more info please see here: https://github.com/hollie/misterhouse/wiki/Contributing#using-perltidy-to-make-consistent-formatted-code I think that there is lots of interesting code in this pull request, so if you could update the changes requested by Marc and rerun the formatting on your code then we'll look into integrating it into master. Note: if you update your branch this pull request should also receive the updates. This is one of the reasons you should normally not create a pull request from your master branch. |
Sorry, I'm new to git. I had some issues with conflicts and made a mess The changes to WeatherNOAA.pm were all related to this issue, is that OK to Do you want me to cancel the current pull request? _Wayne On Tue, Oct 18, 2016 at 11:16 PM, Marc MERLIN [email protected]
|
anwers
|
The zone is a 3 letter code from: The easiest way I've found to get the zone is to search your zip or If I search Baton Rouge, LA I get redirected to So my zone is: LIX San Jose is: MTR Call it like this: It looks like I can hack together a way to get the zone with the city and If we go this route then get_weather and the user mh.private.ini would not _Wayne On Wed, Oct 19, 2016 at 8:22 AM, Marc MERLIN [email protected]
|
Just to be sure I don't make more of a mess than I already have :) I set up the hook with perl tidy so all my commits will run through it now. Copy my changed files out. git checkout -b Schedule copy SCHEDULE.pm and Generic_Item.pm back git stage SCHEDULE.pm git checkout -b Harmon copy HARMON.pm back git stage HARMON.pm git checkout -b Doorbird copy DOORBIRD.pm back git stage DOORBIRD.pm Fix issues with get_weather noted in current pull request. git checkout -b WeatherNOAA copy WeatherNOAA.pm and get_weather back git stage WeatherNOAA.pm cancel current pull request Let me know if I am on the right track. _Wayne On Wed, Oct 19, 2016 at 4:56 PM, Marc MERLIN [email protected]
|
First, I missed the part that I have to give new arguments to get_weather, it works now, thank you. |
…ded when get_weather is called. Bug hollie#631
Updated Harmon Documentation
Doorbird merge
Fixes for broken code due to NOAA site changes. Bug hollie#631
I made 3 new pull requests, the Harmon and Doorbird requests failed some of I did however run all the code through perl tidy with the hook, so there I updated the weather NOAA code so the zone is not needed anymore. Fixes for broken code due to NOAA site changes. Bug #631
|
Hello Wayne, regarding the tests, yes I'm aware of the problem and I'm looking into it. Might take until the weekend before I find some time to clear that out. Thanks for splitting the contributions in separate pull requests. Best regards, |
Added SCHEDULE module for scheduling object state changes via the web UI. This is the backend code for Howard’s ia7 web code. There are 2 sub modules SCHEDULE_Temp and SCHEDULE_Generic.
SCHEDULE_Temp is for thermostat scheduling.
• It allows users to control any thermostat connected to Misterhouse.
• It has objects for setting the thermostat temperatures for each schedule in the MH web UI.
• It has built in occupancy tracking for changing the thermostat temperature settings based on the time and if someone is home or not, including a vacation mode.
• It has a built in outdoor temperature/forecast tracking to change the thermostat temperature settings based on the time and the forecasted temperature or the current outdoor temperature.
SCHEDULE_Generic is for scheduling object state changes for objects that don’t inherit the scheduling code from the Generic_Item.
Generic_Item now has the scheduling code as well so all Generic_Item objects or objects that inherit Generic_Item will be able to have state changes scheduled via Howard's scheduling web UI code. The schedule check code is not added to the main loop until the user adds a schedule via the web UI and the code is removed from the main loop once all the schedule entries are removed.
get_weather has the fixes from Rick Steeves.
WeatherNOAA has fixes from Rick and I.
DOORBIRD.pm and HARMON.pm now have documentation that converts to HTML properly and can be viewed in the local Misterhouse POD documentation page.
DOORBIRD.pm has been updated to post back to Misterhouse using the no_response option.
_Wayne