jacekk015 / zha_quirks

All quirks in one place
MIT License
126 stars 18 forks source link

ts0601_trv_beca.py wont load in HA. #18

Closed Zedread closed 1 year ago

Zedread commented 1 year ago

Everything was working fine until this last HA update. I'm currently on Home Assistant 2023.9.1

Logger: zhaquirks
Source: custom_zha_quirks/ts0601_trv_beca.py:1
First occurred: 11:04:33 AM (1 occurrences)
Last logged: 11:04:33 AM

Unexpected exception importing custom quirk 'ts0601_trv_beca'
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zhaquirks/__init__.py", line 460, in setup
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_zha_quirks/ts0601_trv_beca.py", line 1, in <module>
    {"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"trv_saswell.py","path":"trv_saswell.py","contentType":"file"},{"name":"ts0601_temperature.py","path":"ts0601_temperature.py","contentType":"file"},{"name":"ts0601_thermostat_avatto.py","path":"ts0601_thermostat_avatto.py","contentType":"file"},{"name":"ts0601_trv_beca.py","path":"ts0601_trv_beca.py","contentType":"file"},{"name":"ts0601_trv_etop.py","path":"ts0601_trv_etop.py","contentType":"file"},{"name":"ts0601_trv_maxsmart.py","path":"ts0601_trv_maxsmart.py","contentType":"file"},{"name":"ts0601_trv_me167.py","path":"ts0601_trv_me167.py","contentType":"file"},{"name":"ts0601_trv_moes.py","path":"ts0601_trv_moes.py","contentType":"file"},{"name":"ts0601_trv_rtitek.py","path":"ts0601_trv_rtitek.py","contentType":"file"},{"name":"ts0601_trv_siterwell.py","path":"ts0601_trv_siterwell.py","contentType":"file"},{"name":"ts0601_trv_zonnsmart.py","path":"ts0601_trv_zonnsmart.py","contentType":"file"}],"totalCount":13}},"fileTreeProcessingTime":3.141255,"foldersToFetch":[],"reducedMotionEnabled":null,"repo":{"id":592465794,"defaultBranch":"main","name":"zha_quirks","ownerLogin":"jacekk015","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-01-23T19:41:50.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/14165726?v=4","public":true,"private":false,"isOrgOwned":false},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"main","listCacheKey":"v0:1674505041.9374","canEdit":false,"refType":"branch","currentOid":"0a7c52d7d3d6b2a6d076804ccc04571a4aa1417c"},"path":"ts0601_trv_beca.py","currentUser":null,"blob":{"rawLines":["\"\"\"Beca TRV devices support.\"\"\"","import logging","from typing import Optional, Union","","import zigpy.types as t","from zhaquirks import Bus, LocalDataCluster","from 
...

{"post":"YL53Sad9qLfhnjWITUREwCyzckI85ey1Fz8B5_QTfDo0GmxGiB0D7qFYbcTT4N8biFvZF1RkVEvzmQvY5cXPEw"}}},"title":"zha_quirks/ts0601_trv_beca.py at main · jacekk015/zha_quirks"}
                                      ^^^^^
NameError: name 'false' is not defined

Had to truncate log in order to be able to post. Seems like a problem with HA code but i wanted to confirm with you first.

jacekk015 commented 1 year ago

And you probably truncated actuall error reason. Post it as a text file. Paste that to txt file and just drag&drop to post window. It will go as a attachement.

Zedread commented 1 year ago

HA-Error_log_beca_trv.txt Here goes the full error, and yes i messed up the log.

jacekk015 commented 1 year ago

Wait a minute... it looks like you copy/pasted html in the *.py file! I see css and all styling there!

Go here: https://github.com/jacekk015/zha_quirks/blob/main/ts0601_trv_beca.py 3-dots button top-right Raw file content -> Download

Don't copy/paste code window with HTML formatting.

Zedread commented 1 year ago

Yeah, its was my fault, i used wget to fetch the file but feed it the wrong url. Now that i've set the raw content url everything works fine. Thank you for your time.