Skip to content

Service name regex #102

@CharlesBlonde

Description

@CharlesBlonde

Hi,

I'm currently working on writing a library in order to control Dyson Pure Cool link devices (http://www.dyson.com/air-treatment/purifiers/dyson-pure-hot-cool-link.aspx) and I have an issue with the service name.
The service name is dyson_mqtt and the validation regex (https://github.com/jstasiak/python-zeroconf/blob/master/zeroconf.py#L151) doesn't accept this name because of the underscore.

Of course, it's quite simple to provide a pull request to update this regex but I think this regex exists to follow the RFC. Can you confirm an underscore in the service name is not valid ?

If yes, what can be the best solution ? Right now I'm using an hacked version with the following regex:

_HAS_ONLY_A_TO_Z_NUM_HYPHEN = re.compile(r'^[A-Za-z0-9\-\_]+$')

But I would prefer to use an official version. If I have no choice I'll embedded this hacked version but I would like to avoid

Thanks for your help,

Charles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions