Use Float instead of Numeric on NumericSensor table.

The Numeric type may have casting/rounding issues with SQLite.
This commit is contained in:
Fabio Manganiello 2022-12-18 15:25:22 +01:00
parent 5763c5e0ba
commit 3615a269fe
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 4 additions and 4 deletions

View File

@ -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__ = {