Fix SQL sensor (#67144)
This commit is contained in:
parent
6364e81be5
commit
fff74c66ae
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import date
|
||||
import decimal
|
||||
import logging
|
||||
import re
|
||||
|
||||
|
@ -158,7 +159,7 @@ class SQLSensor(SensorEntity):
|
|||
_LOGGER.debug("result = %s", res.items())
|
||||
data = res[self._column_name]
|
||||
for key, value in res.items():
|
||||
if isinstance(value, float):
|
||||
if isinstance(value, decimal.Decimal):
|
||||
value = float(value)
|
||||
if isinstance(value, date):
|
||||
value = value.isoformat()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue