Skip to content

Commit

Permalink
feat/units_from_session
Browse files Browse the repository at this point in the history
add missing "magic properties" for session aware user preferences

needs OpenVoiceOS/ovos-bus-client#90
  • Loading branch information
JarbasAl authored Apr 20, 2024
1 parent 056f3cb commit 3108f0d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,34 @@ def dialog_renderer(self) -> Optional[MustacheDialogRenderer]:
session or else from Configuration.
"""
return self.resources.dialog_renderer

@property
def system_unit(self) -> str:
"""
Get the units preference (metric vs imperial)
This info may come from Session, eg, injected by a voice satellite
"""
sess = SessionManager.get()
return sess.system_unit

@property
def date_format(self) -> str:
"""
Get the date format (DMY/MDY/YMD)
This info may come from Session, eg, injected by a voice satellite
"""
sess = SessionManager.get()
return sess.date_format

@property
def time_format(self) -> str:
"""
Get the time format (half vs full)
This info may come from Session, eg, injected by a voice satellite
"""
sess = SessionManager.get()
return sess.time_format

@property
def location(self) -> dict:
"""
Expand Down

0 comments on commit 3108f0d

Please sign in to comment.