• 大小: 0.89M
    文件类型: .zip
    金币: 2
    下载: 2 次
    发布日期: 2021-03-26
  • 语言: 其他
  • 标签: 其他  

资源简介


esp32自动获取天气及时钟在oled显示,支持中文,物联网

资源截图

代码片段和文件信息

import json

class GDJson():

    def __init__(self):

        pass

    def jsonParse(selfdata):

        return json.loads(data)

    def parseHeWeather(selfdata):
        jsonData = self.jsonParse(data)
        base = jsonData[‘HeWeather5‘][0]
        daily_forecast = base[‘daily_forecast‘]
        now = base[‘now‘]
        suggestion = base[‘suggestion‘]


        return {
            “value“: {
                ‘tody‘:{
                    ‘status‘:int(daily_forecast[0][‘cond‘][‘code_d‘])
                    ‘date‘:daily_forecast[0][‘date‘]
                    ‘now‘:now[‘tmp‘] + ‘C‘
                    ‘range‘: self.range(daily_forecast[0][‘tmp‘][‘max‘]daily_forecast[0][‘tmp‘][‘min‘])
                    ‘s‘:daily_forecast[0][‘cond‘][‘txt_d‘]
                }
                ‘tom‘: {
                    ‘status‘:int(daily_forecast[1][‘cond‘][‘code_d‘])
                    ‘date‘: daily_forecast[1][‘date‘]
                    ‘range‘: self.range(daily_forecast[1][‘tmp‘][‘

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-10 07:11  GDWeatherStation-master\
     目录           0  2019-01-10 07:11  GDWeatherStation-master\GDWeatherStation\
     文件        6764  2019-01-10 07:11  GDWeatherStation-master\GDWeatherStation\GDDraw.h
     文件       16869  2019-01-10 07:11  GDWeatherStation-master\GDWeatherStation\GDIcon.h
     文件        1116  2019-01-10 07:11  GDWeatherStation-master\GDWeatherStation\GDWeatherStation.ino
     文件        5516  2019-01-10 07:11  GDWeatherStation-master\GDWeatherStation\GDWifi.h
     文件        8591  2019-01-10 07:11  GDWeatherStation-master\README.md
     目录           0  2019-01-10 07:11  GDWeatherStation-master\Service\
     文件        2486  2019-01-10 07:11  GDWeatherStation-master\Service\GDParseJson.py
     文件         692  2019-01-10 07:11  GDWeatherStation-master\Service\GDUserData.py
     文件        4773  2019-01-10 07:11  GDWeatherStation-master\Service\GDWeatherJson.py
     文件         527  2019-01-10 07:11  GDWeatherStation-master\Service\Main.py
     文件        1981  2019-01-10 07:11  GDWeatherStation-master\Service\test.py
     文件         290  2019-01-10 07:11  GDWeatherStation-master\Service\urwidTest.py
     文件         276  2019-01-10 07:11  GDWeatherStation-master\Service\userData.json
     文件       13902  2019-01-10 07:11  GDWeatherStation-master\Service\userIcon.txt
     目录           0  2019-01-10 07:11  GDWeatherStation-master\UI_Design\
     文件     1941504  2019-01-10 07:11  GDWeatherStation-master\UI_Design\65 Weather Icons.sketch
     文件       67362  2019-01-10 07:11  GDWeatherStation-master\UI_Design\UI.sketch
     目录           0  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\
     文件         382  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136818.bmp
     文件         615  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136818.png
     文件         102  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136821.bmp
     文件         759  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136821.png
     文件         382  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136822.bmp
     文件         637  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136822.png
     文件         102  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136904.bmp
     文件         657  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1136904.png
     文件         382  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1137170.bmp
     文件         668  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1137170.png
     文件         382  2019-01-10 07:11  GDWeatherStation-master\UI_Design\icon\1137171.bmp
............此处省略64个文件信息

评论

共有 条评论