-
Notifications
You must be signed in to change notification settings - Fork 297
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
station registration silently fails if hardware_name is not a @property #936
Comments
I've changed weereg to give a little better error message. Now it will give something like
As you can see, the problem is that As for the "bound method" problem, the documentation clearly says that |
I dunno, I was being completely serious. Just wanted to use a bogus URL to make 'anything' unique enough to trigger the registration attempt but I was trying to be mindful of your automation and server load so you didn't try to query a non-existent URL for the images for the map. Perhaps "not a valid url" might be better wording there. I do see the words in the docs, but certainly didn't really understand the meaning of them. What had (has) me confused is why the entire rest of weewx seemed to be able to handle not having Regardless - thanks for taking a look. I got the upstream driver author to merge a PR for that driver so the underlying driver thing is resolved too if folks update their driver to something restx.py is expecting. |
I'm being serious, too. I use There's no end of things we could check. In this case, if the author uses a method instead of a property, Python does the right thing: it raises a |
Seen on the WeatherFlowUDP module - discussion at https://groups.google.com/g/weewx-user/c/JWTsu4s3TvY
The longstanding WeatherFlowUDP driver does not declare its hardware name as a property, which currently results in station registration silently failing for sites using that driver.
I'd also suggest the 'implement the driver' section in the Customization Guide might be made a little clearer than 'look at these examples' for how to do a driver. While we can see
@property
throughout those example, that doesn't really explain the 'why' nor what is a hard requirement for the driver authors.I am uncertain if Rich's suggestion of adding
@property
in the driver abovedef hardware_name(self)
in this particular driver actually works or not. After doing so with a new bogus URL in weewx.conf and restarting weewx it seems like registration is still failing although the debug string looks like JSON to me. I can't decipher what it's looking for nor why it was considered a bad request.Looking for Registry in the log with a little debugging added to restx.py returned:
Hope this helps....
The text was updated successfully, but these errors were encountered: