File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
custom_components/ha_text_ai Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 7
7
@source: https://github.com/smkrv/ha-text-ai
8
8
"""
9
9
import os
10
+ import json
10
11
from typing import Final
11
12
import voluptuous as vol
12
13
from homeassistant .const import Platform , CONF_API_KEY , CONF_NAME
32
33
with open (MANIFEST_PATH ) as manifest_file :
33
34
manifest = json .load (manifest_file )
34
35
VERSION = manifest .get ("version" , "unknown" )
35
- except Exception :
36
+ except FileNotFoundError :
36
37
VERSION = "unknown"
38
+ _LOGGER .warning ("manifest.json not found at %s" , MANIFEST_PATH )
39
+ except json .JSONDecodeError as err :
40
+ VERSION = "unknown"
41
+ _LOGGER .error ("Error decoding JSON from manifest.json: %s" , err )
42
+ except Exception as err :
43
+ VERSION = "unknown"
44
+ _LOGGER .error ("Error reading manifest.json: %s" , err )
37
45
38
46
# Default endpoints
39
47
DEFAULT_OPENAI_ENDPOINT : Final = "https://api.openai.com/v1"
You can’t perform that action at this time.
0 commit comments