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

fix: handle state where garage door has tried to close but fails by r… #44

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .idea/checkstyle-idea.xml
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions .idea/libraries/Maven__com_pi4j_pi4j_core_1_2_SNAPSHOT.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/libraries/Maven__commons_io_commons_io_2_6.xml

This file was deleted.

1 change: 0 additions & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.14</version>
<version>2.7.18</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
Expand Down Expand Up @@ -115,8 +115,15 @@
<phase>package</phase>
<configuration>
<target>
<scp file="${project.basedir}/target/garageOpener-1.0.0.jar" keyfile="${user.home}/.ssh/id_rsa" passphrase="" todir="pi@${host}:/home/pi/com/bigboxer23/garageOpener/1.0.0" trust="true"/>
<sshexec command="sudo systemctl restart garage.service" host="${host}" keyfile="${user.home}/.ssh/id_rsa" trust="true" username="pi"/>
<exec executable="scp">
<arg value="${project.basedir}/target/garageOpener-1.0.0.jar"/>
<arg value="pi@${host}:/home/pi/com/bigboxer23/garageOpener/1.0.0"/>
</exec>
<exec executable="ssh">
<arg value="-tt"/>
<arg value="pi@${host}"/>
<arg value="sudo systemctl restart garage.service"/>
</exec>
</target>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public void iterate() {
myOpenTime = System.currentTimeMillis() + kAutoCloseDelay;
myActionService.closeDoor();
}
if (myOpenTime == -1 && isGarageDoorOpen()) {
logger.warn("Detected unset open time and open garage door, setting open time");
myOpenTime = System.currentTimeMillis() + kAutoCloseDelay;
}
}

public long getHistoricOpenTime() {
Expand Down