Skip to content

Commit c13937c

Browse files
committed
Fix file creation
1 parent f83ab2f commit c13937c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

custom_components/bluecon/ConfigFolderNotificationInfoStorage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def retrieveCredentials(self) -> dict[str, dict[str, Any]] | None:
1818
return None
1919

2020
def storeCredentials(self, credentials: dict[str, dict[str, Any]]):
21-
with open(self.__credentialsFileName, "w") as f:
21+
with open(self.__credentialsFileName, "w+") as f:
2222
json.dump(credentials, f)
2323

2424
def retrievePersistentIds(self) -> list[str] | None:
@@ -29,5 +29,5 @@ def retrievePersistentIds(self) -> list[str] | None:
2929
return None
3030

3131
def storePersistentId(self, persistentId: str):
32-
with open(self.__persistentIdsFileName, "a") as f:
32+
with open(self.__persistentIdsFileName, "a+") as f:
3333
f.write(persistentId + "\n")

custom_components/bluecon/ConfigFolderOAuthTokenStorage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ def retrieveOAuthToken(self) -> OAuthToken:
1212
return OAuthToken.fromJson(f)
1313

1414
def storeOAuthToken(self, oAuthToken: OAuthToken):
15-
with open(self.__oAuthTokenFileName, "w") as f:
15+
with open(self.__oAuthTokenFileName, "w+") as f:
1616
f.write(oAuthToken.toJson())

custom_components/bluecon/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"domain": "bluecon",
33
"name": "Fermax Blue",
4-
"version": "0.1.11",
4+
"version": "0.1.12",
55
"documentation": "https://hass-bluecon.afonsogarcia.dev/",
66
"issue_tracker": "https://github.com/AfonsoFGarcia/hass-bluecon/issues",
77
"requirements": ["bluecon==0.1.2", "aiohttp", "oscrypto", "protobuf", "http-ece"],

0 commit comments

Comments
 (0)