You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? If so, please describe the problem.
Only two predefined date/time stats are available: DAY and HOUR.
Describe the feature / solution to your problem you'd like
The ability to define additional date/time stats entries.
Describe alternatives you've considered / and or tested
Could be implemented via custom stats, however native support would be appreciated.
Screenshots / photos & mockups of the Turing screen
In the simulator screenshot below, DAY is displaying "day month year" at the top left, HOUR is at the top right. This has been achieved by following the Babel date formatting according to this comment: #99 (comment)
Below DAY is shown the "current" weekday as static text: "Wednesday" (would be FORMAT: "EEEE").
(Note: I don't know Python, but was able to modify the simulator to use the current date. Everything else are the STATIC values.)
Environment:
Revision of this project: Release 3.3.4
OS with version: Kubuntu 22.04
Python version: 3.10.12
Hardware: Simulator (AMD FX-8350)
Additional context
This would open a lot of theme formatting flexibility.
Based on the errors I've seen playing with the Babel date formatting, each custom DATE entry would probably need to declare whether it instantiates a datetime.time or datetime.date object internally, i.e
OBJECT: date # date (day/week/month/year, etc) / time (hour/minute/second, etc)
Thus, the DATE entry I faked in the screenshot above could be achieved via:
I managed to implement this via sensors_custom.py:
from datetime import datetime
import tzlocal
# Custom data class to display day of the week
class CustomDayOfWeek(CustomDataSource):
def as_numeric(self) -> float:
# If there is no numeric value, keep this function empty
pass
def as_string(self) -> str:
# If a custom data class only has text values, it won't be possible to display graph or radial bars
return datetime.now(tzlocal.get_localzone()).strftime('%A')
Is your feature request related to a problem? If so, please describe the problem.
Only two predefined date/time stats are available:
DAY
andHOUR
.Describe the feature / solution to your problem you'd like
The ability to define additional date/time stats entries.
Describe alternatives you've considered / and or tested
Could be implemented via custom stats, however native support would be appreciated.
Screenshots / photos & mockups of the Turing screen
In the simulator screenshot below,
DAY
is displaying "day month year" at the top left,HOUR
is at the top right. This has been achieved by following the Babel date formatting according to this comment: #99 (comment)Below
DAY
is shown the "current" weekday as static text: "Wednesday" (would beFORMAT: "EEEE"
).(Note: I don't know Python, but was able to modify the simulator to use the current date. Everything else are the STATIC values.)
Environment:
Additional context
This would open a lot of theme formatting flexibility.
Based on the errors I've seen playing with the Babel date formatting, each custom
DATE
entry would probably need to declare whether it instantiates adatetime.time
ordatetime.date
object internally, i.eThus, the
DATE
entry I faked in the screenshot above could be achieved via:The text was updated successfully, but these errors were encountered: