From 3615a269fe84321d8dbc2ffa522bcbf22479073f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 18 Dec 2022 15:25:22 +0100 Subject: [PATCH] Use Float instead of Numeric on NumericSensor table. The Numeric type may have casting/rounding issues with SQLite. --- platypush/entities/sensors.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platypush/entities/sensors.py b/platypush/entities/sensors.py index 91ee70242..3cad59165 100644 --- a/platypush/entities/sensors.py +++ b/platypush/entities/sensors.py @@ -3,10 +3,10 @@ import logging from sqlalchemy import ( Boolean, Column, + Float, ForeignKey, Integer, JSON, - Numeric, String, ) @@ -44,9 +44,9 @@ if 'numeric_sensor' not in Base.metadata: id = Column( Integer, ForeignKey(Device.id, ondelete='CASCADE'), primary_key=True ) - value = Column(Numeric) - min = Column(Numeric) - max = Column(Numeric) + value = Column(Float) + min = Column(Float) + max = Column(Float) unit = Column(String) __mapper_args__ = {