mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Fix SQL sensor (#67144)
This commit is contained in:
parent
6364e81be5
commit
fff74c66ae
@ -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…
x
Reference in New Issue
Block a user