Skip to content

Commit

Permalink
Added equals method to DataIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Aug 8, 2020
1 parent e1fb265 commit c63554c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import me.retrodaredevil.solarthing.annotations.NotNull;
import me.retrodaredevil.solarthing.packets.identification.Identifier;

import java.util.Objects;

public final class DataIdentifier implements Identifier {
private final int dataId;

Expand All @@ -20,4 +22,17 @@ public DataIdentifier(int dataId) {
public int getDataId() {
return dataId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DataIdentifier that = (DataIdentifier) o;
return getDataId() == that.getDataId();
}

@Override
public int hashCode() {
return Objects.hash(getDataId());
}
}
9 changes: 6 additions & 3 deletions other/docs/quickstart_pvoutput.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Quick Start With PVOutput
If you haven't already, [click here](quickstart.md) to view how to clone this repo and install the service.

**NOTE**: This program is a supplement to either the `mate` or `rover` program and is not set up to get data
from solar devices.
**NOTE**: This program is a supplement to other programs (such as `mate` or `rover`) and is not set up to get data from solar devices directly.

Once everything is installed, you're ready to edit the configs. You will cd to the `program` directory.
```
Expand Down Expand Up @@ -35,6 +34,7 @@ You can view an advanced configuration [here](../../config_templates/base/pvoutp
```json5
{
// ...
"join_teams": true,
"time_zone": "US/Mountain",
"default_fragment": 1,
"include_undefined_sources": true,
Expand All @@ -51,6 +51,8 @@ You can view an advanced configuration [here](../../config_templates/base/pvoutp
}
}
```
* `join_teams` normally set to true. When true, the program will automatically join the SolarThing team. Keep this
enabled to be on the SolarThing team! (Defaults to false if not defined)
* `time_zone` can be used to set the time zone if you want to use a different time zone than the current system time zone.
* `default_fragment` usually should never be defined. It's only for users who've been using SolarThing since before 2020.
* `include_undefined_sources` usually should never be defined. It's only for users who've been using SolarThing since before 2020.
Expand All @@ -72,7 +74,8 @@ Once your configuration is how you want it, you can go back to the [quickstart](
#### Why is this a separate program and not a "database"?
This project is set up this way because it makes future changes easier. If you were to use an advanced feature of
this project such as fragmented packets, the only way to upload all of your data to pvoutput would be to do it
in one program instead of two.
in one program instead of two. And if your charge controller resets in the middle of the day,
(maybe your clock is off or you have wind power) the daily kWh generation won't become off.

This means that you can have multiple instances of SolarThing running and compile data from
each program and upload to PVOutput all at once.

0 comments on commit c63554c

Please sign in to comment.