Skip to content

src/robot/configs #29

Closed
Closed

Description

@KavinduMethpura
No description provided.

Activity

  1. Hasala-Kavinda commented on Nov 13, 2025

    @Hasala-Kavinda

    MODIFICATION #1
    src/robot/configs/mqtt_settings.py
    instead having a function with the same name as inbuilt function print can have different one.and also can use dataclass decorator with the class

    @dataclass
    class MQTTSettings:
        server: Optional[str] = None
        port: int = 1883
        user_name: Optional[str] = None
        password: Optional[str] = None
        channel: Optional[str] = None
        
        def print_settings(self) -> None:
            print(f"server: {self.server}")
            print(f"port: {self.port}")
            print(f"username: {self.user_name}")
            print(f"password: {'(set)' if self.password else '(unset)'}")
            print(f"channel: {self.channel}")
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions