Registry / devops / sensor-state-data

sensor-state-data

JSON →
library2.20.0pypypi✓ verified 83d ago

Models for storing and converting SensorData state from Bluetooth devices. Current version 2.20.0, last updated 2024. Released on PyPI, maintained actively with monthly releases.

pip install sensor-state-data
INSTALL
IMPORT
SIG · SENSOR-STATE-DATA
S
sensor-state-data
devopspythonv2.20.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SensorDeviceInfo
from sensor_state_data import SensorDeviceInfo
from sensorstatedata import SensorDeviceInfo
Library uses underscores in package name
SensorValue
from sensor_state_data import SensorValue
SensorUpdate
from sensor_state_data import SensorUpdate

Example of creating a SensorUpdate object for a temperature sensor.

from sensor_state_data import SensorDeviceInfo, SensorValue, SensorUpdate device = SensorDeviceInfo( name="Test Sensor", model="TestModel", manufacturer="TestCorp", sw_version="1.0", hw_version="1.0", ) value = SensorValue( name="temperature", native_unit="°C", native_value=25.0, ) update = SensorUpdate( device_info=device, sensor_values=[value], timestamp=1234567890.0, ) print(update)
Debug
Known issues
gotchaThe package name contains hyphens but the import uses underscores: 'sensor-state-data' vs 'sensor_state_data'. Typo in import leads to ModuleNotFoundError.
fix
Use 'pip install sensor-state-data' and 'from sensor_state_data import ...'
affects: all
breakingIn version 2.x, the SensorValue constructor changed: 'native_value' is now required and 'state_class' default removed.
fix
Always provide 'native_value'. If you used 'state_class' before, set it explicitly if needed.
affects: 2.0.0+
gotchaTimestamp is expected as a float (Unix timestamp). Passing a datetime object will cause a TypeError.
fix
Convert datetime to timestamp: update.timestamp = datetime.now().timestamp()
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'sensorstatedata'
Wrong import path; hyphens vs underscores confusion.
fix
Install with 'pip install sensor-state-data' and import as 'from sensor_state_data import ...'
TypeError: SensorValue.__init__() missing 1 required positional argument: 'native_value'
Omitting native_value when constructing SensorValue.
fix
Pass native_value: SensorValue(name='temp', native_unit='°C', native_value=25.0)
Upgrade
Version history
2.20.0latest on PyPI · released Nov 2, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
18
OpenAI (training)
1
Resources
sensor-state-data — pip install sensor-state-data · libregistry