Skip to content

Commit

Permalink
Merge pull request #460 from SUPLA/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
przemyslawzygmunt authored Dec 18, 2024
2 parents 64af3f5 + e5eec05 commit 2f28d9f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions SUPLA.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8145,7 +8145,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SUPLA/SUPLA.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 215;
CURRENT_PROJECT_VERSION = 216;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T6ZPGSWA75;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand Down Expand Up @@ -8184,7 +8184,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SUPLA/SUPLA.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 215;
CURRENT_PROJECT_VERSION = 216;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T6ZPGSWA75;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ final class ElectricityMeterGeneralStateHandlerImpl: ElectricityMeterGeneralStat
if (measuredValues.contains(.voltagePhaseAngle12)) {
result.append(.init(
type: .voltagePhaseAngle12,
value: formatter.format(value.voltagePhaseAngle12(), withUnit: false, precision: SuplaElectricityMeasurementType.voltagePhaseAngle12.precision)
value: formatter.format(value.voltagePhaseAngle12(), withUnit: false, precision: .customPrecision(value: SuplaElectricityMeasurementType.voltagePhaseAngle12.precision))
))
}
if (measuredValues.contains(.voltagePhaseAngle13)) {
result.append(.init(
type: .voltagePhaseAngle13,
value: formatter.format(value.voltagePhaseAngle13(), withUnit: false, precision: SuplaElectricityMeasurementType.voltagePhaseAngle13.precision)
value: formatter.format(value.voltagePhaseAngle13(), withUnit: false, precision: .customPrecision(value: SuplaElectricityMeasurementType.voltagePhaseAngle13.precision))
))
}
if (measuredValues.contains(.voltagePhaseSequence)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private func mockSetsForMultiplePhases() -> ChannelChartSets {
return ChannelChartSets(
remoteId: 124,
function: 123,
name: "Reverse active energy",
name: Strings.ElectricityMeter.forwardActiveEnergy,
aggregation: .minutes,
dataSets: [
HistoryDataSet(
Expand Down Expand Up @@ -241,7 +241,7 @@ private func mockSetsForMultiplePhases() -> ChannelChartSets {
active: true
)
],
typeName: "Reverse active energy"
typeName: Strings.ElectricityMeter.forwardActiveEnergy
)
}

Expand All @@ -251,7 +251,7 @@ private func mockSetsForSinglePhase() -> ChannelChartSets {
return ChannelChartSets(
remoteId: 124,
function: 123,
name: "Reverse active energy",
name: Strings.ElectricityMeter.forwardActiveEnergy,
aggregation: .minutes,
dataSets: [
HistoryDataSet(
Expand All @@ -270,7 +270,7 @@ private func mockSetsForSinglePhase() -> ChannelChartSets {
active: true
)
],
typeName: "Reverse active energy"
typeName: Strings.ElectricityMeter.forwardActiveEnergy
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ enum SuplaElectricityMeasurementType: Identifiable, Codable, CaseIterable, Picke
var precision: Int {
switch (self) {
case .frequency,
.voltagePhaseAngle12,
.voltagePhaseAngle13,
.voltagePhaseSequence,
.currentPhaseSequence,
.voltage,
Expand All @@ -229,6 +227,8 @@ enum SuplaElectricityMeasurementType: Identifiable, Codable, CaseIterable, Picke
.reverseActiveEnergy,
.forwardReactiveEnergy,
.reverseReactiveEnergy: 5
case .voltagePhaseAngle12,
.voltagePhaseAngle13: 1
default: 0
}
}
Expand Down
4 changes: 2 additions & 2 deletions SUPLA/SAElectricityMeterExtendedValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ NS_ASSUME_NONNULL_BEGIN
- (double) totalReverseActiveEnergyBalanced;
- (unsigned int) measuredValues;
- (BOOL) currentIsOver65A;
- (int) voltagePhaseAngle12;
- (int) voltagePhaseAngle13;
- (double) voltagePhaseAngle12;
- (double) voltagePhaseAngle13;
- (TElectricityMeter_ExtendedValue_V3) getStruct;
@end

Expand Down
8 changes: 4 additions & 4 deletions SUPLA/SAElectricityMeterExtendedValue.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ - (BOOL) currentIsOver65A {
&& (_emev.measured_values & EM_VAR_CURRENT_OVER_65A) != 0;
}

- (int) voltagePhaseAngle12 {
return _emev.voltage_phase_angle_12;
- (double) voltagePhaseAngle12 {
return _emev.voltage_phase_angle_12 / 10.0;
}

- (int) voltagePhaseAngle13 {
return _emev.voltage_phase_angle_13;
- (double) voltagePhaseAngle13 {
return _emev.voltage_phase_angle_13 / 10.0;
}

- (TElectricityMeter_ExtendedValue_V3) getStruct {
Expand Down

0 comments on commit 2f28d9f

Please sign in to comment.