Tom, where can I add "context='long_delta' ? python? or Weewx direct in cheetahgenerator? I use no extension - my "uptime" is a value from the archive records in the database. My meaning is: that the default-settings for deltatime in 4.6 are not used
tke...@gmail.com schrieb am Samstag, 12. Februar 2022 um 13:35:50 UTC+1: > Werner, > > See this thread: > https://groups.google.com/g/weewx-user/c/aBWSIwicKkk/m/x2EJlPkzEAAJ > > On Fri, Feb 11, 2022 at 11:02 AM 'Werner Krenn' via weewx-user < > weewx...@googlegroups.com> wrote: > >> seems that in 4.6.x on RasPi 4 (Buster) >> DEFAULT_DELTATIME_FORMAT = "%(day)d%(day_label)s, " \ >> "%(hour)d%(hour_label)s, " \ >> "%(minute)d%(minute_label)s" >> >> raised alway an execption here: >> <tr> >> <td class="label">$obs.label.uptime</td> >> <td >> class="data">$current($max_delta=3600,$data_binding='davishealthapi_binding').uptime</td> >> </tr> >> >> uptime: >> weewx.units.obs_group_dict["uptime"] = "group_deltatime" >> >> >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/share/weewx/weewx/cheetahgenerator.py", line 344, in generate >> weewx[13269] ERROR weewx.cheetahgenerator: **** unicode_string = >> compiled_template.respond() >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "_etc_weewx3_skins_health_index_html_tmpl.py", line 178, in respond >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1707, in >> _handleCheetahInclude >> weewx[13269] ERROR weewx.cheetahgenerator: **** >> self._CHEETAH__cheetahIncludes[_includeID].respond(trans) >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "_etc_weewx3_skins_health_sensors_inc.py", line 706, in respond >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/share/weewx/weewx/cheetahgenerator.py", line 819, in filter >> weewx[13269] ERROR weewx.cheetahgenerator: **** filtered = >> six.text_type(val) >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/share/weewx/weewx/units.py", line 1005, in __str__ >> weewx[13269] ERROR weewx.cheetahgenerator: **** s = self.toString() >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/share/weewx/weewx/units.py", line 1000, in toString >> weewx[13269] ERROR weewx.cheetahgenerator: **** localize=localize) >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/share/weewx/weewx/units.py", line 688, in toString >> weewx[13269] ERROR weewx.cheetahgenerator: **** s = >> self._to_string(val_t, context, addLabel, useThisFormat, None_string, >> localize) >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/share/weewx/weewx/units.py", line 748, in _to_string >> weewx[13269] ERROR weewx.cheetahgenerator: **** val_str = >> self.delta_secs_to_string(val_t[0], format_string) >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/share/weewx/weewx/units.py", line 796, in delta_secs_to_string >> weewx[13269] ERROR weewx.cheetahgenerator: **** ans = >> locale.format_string(label_format, etime_dict) >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/lib/python3.7/locale.py", line 223, in format_string >> weewx[13269] ERROR weewx.cheetahgenerator: **** >> new_val.append(_format(perc.group(), val, grouping, monetary)) >> weewx[13269] ERROR weewx.cheetahgenerator: **** File >> "/usr/lib/python3.7/locale.py", line 187, in _format >> weewx[13269] ERROR weewx.cheetahgenerator: **** formatted = percent >> % value >> weewx[13269] ERROR weewx.cheetahgenerator: **** TypeError: %x format: an >> integer is required, not dict >> >> corrected it now with the code from 4.5.1: >> elif val_t[2] == "group_deltatime": >> # Get a delta-time format string. Use a default if the user >> did not supply one: >> if useThisFormat is None: >> format_string = self.time_format_dict.get("delta_time", >> >> default_time_format_dict["delta_time"]) >> #if useThisFormat is None: >> # format_string = self.time_format_dict.get(context, >> DEFAULT_DELTATIME_FORMAT) >> else: >> >> -- >> You received this message because you are subscribed to the Google Groups >> "weewx-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to weewx-user+...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/c35c3628-24e3-4989-8854-c30778d07cb9n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/weewx-user/c35c3628-24e3-4989-8854-c30778d07cb9n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/6023a06a-d2a6-4335-bcc8-93514d65bcd2n%40googlegroups.com.