Skip to content

"address" argument on LEDs #422

Closed
Closed

Description

@WasabiFan

I was just looking at the LED code and realized that we define an "address" argument, but it's never actually used in that class — the only potential consumer I can think of is the device class's generic string conversion method. Can we remove it? I don't think there is any meaning for an "address" in the context of LEDs.

Activity

  1. ddemidov commented on Oct 24, 2017

    @ddemidov
    Member

    I wonder if non-system LEDs attached to output ports (as in ev3dev/ev3dev#990), have address attribute. If not, then this is a good idea.

  2. dwalton76 commented on Oct 25, 2017

    @dwalton76
    Collaborator

    If we remove it from the list of args we just need to set it to something so the __str__() doesn't barf

  3. ddemidov commented on Oct 25, 2017

    @ddemidov
    Member

    Would not overriding __str__ for the Led class work as well?

  4. dwalton76 commented on Oct 25, 2017

    @dwalton76
    Collaborator

    yep that would work too

  5. self-assigned this
    on Nov 14, 2017
  6. dwalton76 commented on Jan 31, 2018

    @dwalton76
    Collaborator

    Actually, Device.__str__() is ok if no address is defined

    
        def __str__(self):
            if 'address' in self.kwargs:
                return "%s(%s)" % (self.__class__.__name__, self.kwargs.get('address'))
            else:
                return self.__class__.__name__
        
    
  7. added a commit that references this issue on Jan 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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