Skip to content

Commit

Permalink
Fix update setpoint function
Browse files Browse the repository at this point in the history
A internally a wrong argument is provided to the update setpoint
call, causing it to throw and exception instead of updating the
setpoint.

This commit fixes this issue and updates the version and changelog
for a 1.0.1 bugfix release.
  • Loading branch information
psachs committed Jan 6, 2025
1 parent ee869f2 commit 39b3891
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.1] - 2025-1-07

### Fixed

- Fix update setpoint shows wrong argument

## [1.0.0] - 2024-4-22

### Added

- Initial release

[Unreleased]: https://github.com/Sensirion/python-i2c-sfx6xxx/compare/1.0.0...HEAD
[Unreleased]: https://github.com/Sensirion/python-i2c-sfx6xxx/compare/1.0.1...HEAD
[1.0.1]: https://github.com/Sensirion/python-i2c-sfx6xxx/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/Sensirion/python-i2c-sfx6xxx/releases/tag/1.0.0
2 changes: 1 addition & 1 deletion sensirion_i2c_sfx6xxx/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,5 @@ def update_setpoint(self, flow):
- Only applicable for SFC6xxx mass flow controllers.
"""
raw_flow = SignalRawFlow(flow, self._flow_scale_factor, self._flow_offset)
self.sfx6xxx.update_setpoint(raw_flow)
self.sfx6xxx.update_setpoint(raw_flow.value)
return self.sfx6xxx.reset_pointer_to_measurement_buffer()
2 changes: 1 addition & 1 deletion sensirion_i2c_sfx6xxx/result_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SignalRawFlow(AbstractSignal):
"""This signal converts a user flow input from float into the twos-complement representation"""

def __init__(self, flow, flow_scale_factor, flow_offset):
self._raw_flow = int(flow * flow_scale_factor) + flow_offset
self._raw_flow = int(flow * flow_scale_factor + flow_offset)

@property
def value(self):
Expand Down
2 changes: 1 addition & 1 deletion sensirion_i2c_sfx6xxx/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

version = "1.0.0"
version = "1.0.1"

0 comments on commit 39b3891

Please sign in to comment.