Git Product home page Git Product logo

Comments (12)

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

是字符数超了吗?有解决办法吗?

from heweather.

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

image
{"code":"200","updateTime":"2023-06-15T09:28+08:00","fxLink":"https://www.qweather.com/severe-weather/zhaoyuan-101120506.html","warning":[{"id":"10112050620230615062600469183110","sender":"山东省气象台","pubTime":"2023-06-15T06:26+08:00","title":"山东省气象台继续发布高温橙色预警","startTime":"2023-06-15T06:26+08:00","endTime":"2023-06-16T06:27+08:00","status":"update","level":"橙色","severity":"Severe","severityColor":"Orange","type":"1009","typeName":"高温","urgency":"","certainty":"","text":"山东省气象台于6月15日06时继续发布高温橙色预警:受大陆暖高压脊影响,15—17日我省将出现高温天气。其中,15—16日,内陆和北部沿海地区38℃左右,局部可达40℃,南部沿海地区23~27℃;17日,鲁西北和鲁中地区36~39℃,南部沿海地区23~27℃,其他地区32~35℃。","related":"10112050620230614161600772913906"},{"id":"10112050620230614160000815320172","sender":"招远市气象台","pubTime":"2023-06-14T16:00+08:00","title":"招远市气象台发布高温黄色预警[Ⅲ/较重]","startTime":"2023-06-14T16:00+08:00","endTime":"2023-06-17T16:02+08:00","status":"active","level":"黄色","severity":"Moderate","severityColor":"Yellow","type":"1009","typeName":"高温","urgency":"","certainty":"","text":"招远市气象台2023年06月14日16时00分发布高温黄色预警信号:受大陆暖高压脊影响,预计15~17日,我市全部镇街将出现高温天气,最高气温可达35℃以上,局部地区超过37℃。请注意防范高温天气对户外作业、城市生活等带来的不利影响。","related":""}],"refer":{"sources":["12379"],"license":["CC BY-SA 4.0"]}}

from heweather.

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

image
如果是state的字数不允许超过255,那有没有办法把自然灾害预警像彩云天气一样,写到属性里

from heweather.

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

image
image
经测试,一条的情况下加上标题也有可能超255字符,何况我这边今天看到的是两条信息,加起来有500多个字符了,肯定超了,我找了个一条的地区,然后加上标题也是超过255字符了,我这边在代码里把标题去掉了,可以正常显示
image

from heweather.

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

image
临时解决方案,不让他合并显示了,把标题去掉,添加了listall和listtitle两个列表,for循环时循环添加,然后取第一条(即最新发布的一条),还是希望大佬有时间的话尝试看能不能写到属性里,state里的最大长度确实是255,我这边删掉标题才勉强不超过255
image
image
加上标题的话280多个字符了,

from heweather.

c1pher-cn avatar c1pher-cn commented on September 23, 2024

from heweather.

c1pher-cn avatar c1pher-cn commented on September 23, 2024

from heweather.

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

image
大佬,我不会发合并,我看着属性里的unit_of_measurement没用,我就给写到unit_of_measurement里了,这个应该是计量单位,没什么用,具体的我发到您帖子最下方回复里了,如果您看有什么问题, 就再给优化下,然后可以发布个新版!

from heweather.

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

image
写到属性里以后没有字符限制了,可以多条信息都合并展示出来

from heweather.

c1pher-cn avatar c1pher-cn commented on September 23, 2024

好的,感谢,我周末弄弄

from heweather.

Gzzloveyyt avatar Gzzloveyyt commented on September 23, 2024

image
天气翻译问题,升级到2023.6.2以后,就可以正常显示中文了

from heweather.

c1pher-cn avatar c1pher-cn commented on September 23, 2024

heweather/sensor.py
灾害预警长度问题已经修复,加了一个states属性,有灾害sensor状态会变成on,然后再去读states即可
image

from heweather.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.