mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
Enhance connection handling and add lunar date compatibility
- Updated `ConnectionHandler` to include a flag for managing connection closure after chat. - Introduced a backward-compatible alias for retrieving the current lunar date, ensuring compatibility with existing functionality.
This commit is contained in:
parent
8b5835820c
commit
cc3f4f53f6
2 changed files with 7 additions and 1 deletions
|
|
@ -171,8 +171,9 @@ class ConnectionHandler:
|
|||
|
||||
self.cmd_exit = self.config["exit_commands"]
|
||||
|
||||
# 是否在聊天结束后关闭连接
|
||||
# Close the connection after chat when requested.
|
||||
self.close_after_chat = False
|
||||
self.is_exiting = False
|
||||
self.load_function_plugin = False
|
||||
self.intent_type = "nointent"
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ def get_current_date_formatted() -> str:
|
|||
return "Failed to get date"
|
||||
|
||||
|
||||
def get_current_lunar_date() -> str:
|
||||
"""Backward-compatible alias; western builds use formatted Gregorian date."""
|
||||
return get_current_date_formatted()
|
||||
|
||||
|
||||
def get_current_time_info() -> tuple:
|
||||
"""
|
||||
Get current time information
|
||||
|
|
|
|||
Loading…
Reference in a new issue