Attempting to add column to extended schema

72 views
Skip to first unread message

rich T

unread,
Oct 3, 2020, 6:03:11 PM10/3/20
to weewx-user
I'm attempting to add a column to the extended schema but I get the following error:

pi@raspberrypi:/home/weewx/bin $ sudo ./wee_database /home/weewx/weewx.conf --reconfigure
Traceback (most recent call last):
  File "./wee_database", line 23, in <module>
    import user.extensions  # @UnusedImport
  File "/home/weewx/bin/user/extensions.py", line 20, in <module>
    schema_extended = schemas.wview_extended.schema + [('forecastRule', 'INTEGER')]
TypeError: unsupported operand type(s) for +: 'dict' and 'list'

Here is what I have in the extensions file.

User extensions module
....

import schemas.wview_extended
schema_extended = schemas.wview_extended.schema + [('forecastRule', 'INTEGER')]

thanks

gjr80

unread,
Oct 3, 2020, 6:45:51 PM10/3/20
to weewx-user
You have encountered the difference in format/structure between the new style schema and the old style schema. The new style schema consists of a python dictionary whereas the old style schema was a list. Consequently, you need a slightly different approach when extending the new style schema. Have a look at Extending the existing schema with a new type in the Customisation Guide.

Gary

rich T

unread,
Oct 3, 2020, 6:54:24 PM10/3/20
to weewx-user
Thanks Gary. I will give this a try.

rich T

unread,
Oct 3, 2020, 10:43:37 PM10/3/20
to weewx-user
Works like a charm.  Now I can display the Davis Console Forecasts.
Reply all
Reply to author
Forward
0 new messages