Skip to content

Commit

Permalink
fix: changes 4 code-review
Browse files Browse the repository at this point in the history
  • Loading branch information
tischober committed May 7, 2024
1 parent 98e1215 commit d38e528
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,6 @@ public Emt7110Reading createReading(String inputLine) {
if (inputLine != null) {
Matcher matcher = READING_P.matcher(inputLine);
if (matcher.matches()) {
// Format
// OK EMT7110 84 81 8 237 0 13 0 2 1 6 1 -> ID 5451 228,5V 13mA 2W 2,62kWh
// OK EMT7110 84 162 8 207 0 76 0 7 0 0 1
// OK EMT7110 ID ID VV VV AA AA WW WW KW KW Flags
// | | | | | | | | | | |
// | | | | | | | | | | `--- AccumulatedPower * 100 LSB
// | | | | | | | | | `------ AccumulatedPower * 100 MSB
// | | | | | | | | `--- Power (W) LSB
// | | | | | | | `------ Power (W) MSB
// | | | | | | `--- Current (mA) LSB
// | | | | | `------ Current (mA) MSB
// | | | | `--- Voltage (V) * 10 LSB
// | | | `----- Voltage (V) * 10 MSB
// | | `--- ID
// | `------- ID
// `--- fix "EMT7110"
// logger.trace("Creating reading from: {}", inputLine);

String id = matcher.group(1) + matcher.group(2);
float voltage = (Integer.parseInt(matcher.group(3)) * 256 + Integer.parseInt(matcher.group(4))) / 10f;
float current = (Integer.parseInt(matcher.group(5)) * 256 + Integer.parseInt(matcher.group(6)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public void dispose() {
}

private synchronized void cancelRetry() {
ScheduledFuture<?> retry = this.retry;
if (retry != null) {
retry.cancel(true);
retry = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ thing-type.ec3k.label = ec3k
thing-type.ec3k.description = Ein mit dem JeeLink USB Empfänger verbundenes EC3000 Energiekosten-Messgerät.
thing-type.pca301.label = PCA301
thing-type.pca301.description = Eine mit dem JeeLink USB Empfänger verbundene PCA301 Steckdose.
thing-type.emt7110.label = EMT7110
thing-type.emt7110.description = Eine mit dem JeeLink USB Empfänger verbundene EMT7110 Steckdose.
thing-type.tx22.label = TX22 Sensor
thing-type.tx22.description = Ein mit dem JeeLink USB Empfänger verbundener TX22 Sensor.
thing-type.revolt.label = Revolt Energie-Messgerät
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,4 @@
<label>@text/channel-type.power-frequency.label</label>
<description>@text/channel-type.power-frequency.description</description>
</channel-type>

<channel-type id="voltage-current" advanced="true">
<item-type>Number:ElectricPotential</item-type>
<label>Voltage</label>
<description>Voltage</description>
<state readOnly="true" pattern="%.2f %unit%"/>
</channel-type>
</thing:thing-descriptions>

0 comments on commit d38e528

Please sign in to comment.