feat: added robot_pi_service.py, settings.py; devops: added Makefile for run project; docs: added for run project with Makefile
This commit is contained in:
31
robot_pi_service/settings.py
Normal file
31
robot_pi_service/settings.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class ModelConfig(BaseSettings):
|
||||
"""Модель конфига"""
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file = '.env',
|
||||
env_file_encoding='utf-8',
|
||||
extra='ignore'
|
||||
)
|
||||
|
||||
|
||||
class CommandsRobot(ModelConfig):
|
||||
"""Класс с командами для робота"""
|
||||
|
||||
forward: str
|
||||
backward: str
|
||||
left: str
|
||||
right: str
|
||||
|
||||
|
||||
class Settings(ModelConfig):
|
||||
"""Класс для данных конфига"""
|
||||
|
||||
websocket_host: str
|
||||
websocket_port: int
|
||||
commands_robot: CommandsRobot = CommandsRobot()
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user