Skip to content

Commit

Permalink
Merge pull request #5 from Sensirion/fix-update-setpoint
Browse files Browse the repository at this point in the history
Fix update setpoint function
  • Loading branch information
psachs authored Jan 6, 2025
2 parents ee869f2 + 1c277b1 commit 2a680ff
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ 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
- Fix wrong data format in read product identifier

## [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/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def pack(self):
return self.tx_data.pack([])

tx = TxData(CMD_ID, '>H')
rx = RxData(descriptor='>I8B', convert_to_int=True)
rx = RxData(descriptor='>IQ', convert_to_int=True)


class ResetPointerToMeasurementBuffer(Transfer):
Expand Down
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 2a680ff

Please sign in to comment.