Skip to content

Conversation

@tiyash-basu-frequenz
Copy link
Contributor

Sensor state ON is misleading, as it can mislead users to think that the API controls the on/off state of the sensor. This is not the case, as the API only provides information about the sensor's state. The sensor's state can be OK (indicating that the sensor is functioning correctly) or ERROR (indicating that the sensor is in an error state).

This change renames the SENSOR_STATE_CODE_ON variant to SENSOR_STATE_CODE_OK, which is more accurate and descriptive.

Sensor state `ON` is misleading, as it can mislead users to think that
the API controls the on/off state of the sensor. This is not the case,
as the API only provides information about the sensor's state. The
sensor's state can be `OK` (indicating that the sensor is functioning
correctly) or `ERROR` (indicating that the sensor is in an error state).

This change renames the `SENSOR_STATE_CODE_ON` variant to
`SENSOR_STATE_CODE_OK`, which is more accurate and descriptive.

Signed-off-by: Tiyash Basu <[email protected]>
@tiyash-basu-frequenz tiyash-basu-frequenz self-assigned this May 23, 2025
Copilot AI review requested due to automatic review settings May 23, 2025 08:18
@tiyash-basu-frequenz tiyash-basu-frequenz requested a review from a team as a code owner May 23, 2025 08:18
@tiyash-basu-frequenz tiyash-basu-frequenz linked an issue May 23, 2025 that may be closed by this pull request
@github-actions github-actions bot added part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files labels May 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Renames the SensorStateCode enum variant from ON to OK to more accurately reflect sensor health rather than power state.

  • Updated the proto definition for clarity.
  • Added a release note entry to document the change.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto Changed SENSOR_STATE_CODE_ON to SENSOR_STATE_CODE_OK
RELEASE_NOTES.md Documented the rename in the release notes
Comments suppressed due to low confidence (2)

proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto:52

  • [nitpick] Update this enum comment to match the new 'OK' semantics, e.g., 'The sensor is functioning correctly.'
// The sensor is up and running.

proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto:53

  • Ensure any tests referencing the old SENSOR_STATE_CODE_ON are updated or new tests cover SENSOR_STATE_CODE_OK.
SENSOR_STATE_CODE_OK = 1;

@tiyash-basu-frequenz tiyash-basu-frequenz added this pull request to the merge queue May 23, 2025
Merged via the queue into frequenz-floss:v0.x.x with commit 521b808 May 23, 2025
6 checks passed
@tiyash-basu-frequenz tiyash-basu-frequenz deleted the 311_sensor_state_on branch May 23, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sensor state ON feels inconsistent

2 participants