Skip to content

Commit

Permalink
fix: include ph calibration offset in sensor value, add extra attribu…
Browse files Browse the repository at this point in the history
…tes (#104)
  • Loading branch information
cryptk committed Jun 9, 2024
1 parent 7963e80 commit f41d1f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/omnilogic_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"issue_tracker": "https://github.com/cryptk/haomnilogic-local/issues",
"loggers": ["pyomnilogic_local"],
"requirements": [
"python_omnilogic_local==0.13.1"
"python_omnilogic_local==0.13.2"
],
"ssdp": [],
"version": "0.7.3",
"version": "0.7.4",
"zeroconf": []
}
14 changes: 13 additions & 1 deletion custom_components/omnilogic_local/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,16 @@ def __init__(self, coordinator: OmniLogicCoordinator, context: int) -> None:

@property
def native_value(self) -> StateType | date | datetime | Decimal:
return self.data.telemetry.ph
return self.data.telemetry.ph + self.data.msp_config.calibration_value

@property
def extra_state_attributes(self) -> dict[str, int | str]:
return super().extra_state_attributes | {
"orp": self.data.telemetry.orp,
"mode": self.data.telemetry.mode,
"target_value": self.data.msp_config.target_value,
"ph_value_raw": self.data.telemetry.ph,
"calibration_value": self.data.msp_config.calibration_value,
"ph_low_alarm_value": self.data.msp_config.ph_low_alarm_value,
"ph_high_alarm_value": self.data.msp_config.ph_high_alarm_value,
}

0 comments on commit f41d1f9

Please sign in to comment.