Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sensor type to name to prevent name collisions when restarting home assistant #2

Open
joyrider3774 opened this issue Oct 20, 2016 · 0 comments

Comments

@joyrider3774
Copy link

Hi,

I noticed that with the latest version of home assistant the sensor names are not constant anymore. I'm talking about "name1 name2 name3" the 1 2 3 gets added from hass with duplicate sensor names and can appear random. This has the effect that name1 can sometimes be the temprature sensor but other times the humidity sensor.

This can be easily fixed by changed the name property so it includes the sensortype like so

@property
    def name(self):
        """Return the name of the sensor."""
        return "{}_{}".format(self._name, self._sensor_type)

PS. on a side note are you still going to release this for home assitant io create a pull request ? I'm using it everyday (although my modified version that shows battery information as well) and i'm pretty certain that other users with wireless tags would benefit from this library and component as well. It only takes a bit of work to clean up the component, implement this fix etc. You could even just copy the component to a checked out version of home assistant and create a pull request for it. The only thing you might need to add is the documentation for their website.

Please let me know if you can find time for this if not i'm willing to do it but i would love to have the battery information included so i might link against my fork then to get wirelesstag lib installed which i don't want to do as you created it and deserve all the credit for it so i rather it gets the lib from the main repo being yours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant