Skip to content

Commit 5482004

Browse files
committed
Bugfix - version string
1 parent f5af69d commit 5482004

4 files changed

Lines changed: 18 additions & 19 deletions

File tree

‎dist/Predbat-Table-Card-Next.js‎

Lines changed: 8 additions & 10 deletions
Large diffs are not rendered by default.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "predbat-card-main",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"type": "module",
55
"description": "The Predbat Table Card is **no longer maintained**. It's been a pleasure to serve you, and I hope that folks enjoyed the card while it lasted.",
66
"main": "index.js",

‎src/services/home-assistant-service.ts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,16 @@ export class HomeAssistantService {
102102
};
103103

104104
private _getVersions(entityId: 'update.predbat_version' | 'update.predbat_table_card_update'): SoftwareVersion {
105-
if (process.env.NODE_ENV === 'development') {
105+
try {
106+
const versionEntityAttributes = this.getState(entityId);
107+
const installed = cleanAndValidateVersion(versionEntityAttributes.attributes.installed_version);
108+
const latest = cleanAndValidateVersion(versionEntityAttributes.attributes.latest_version);
109+
110+
return { installed, latest };
111+
}
112+
catch {
106113
return { installed: null, latest: null };
107114
}
108-
109-
const versionEntityAttributes = this.getState(entityId);
110-
const installed = cleanAndValidateVersion(versionEntityAttributes.attributes.installed_version);
111-
const latest = cleanAndValidateVersion(versionEntityAttributes.attributes.latest_version);
112-
113-
return { installed, latest };
114115
}
115116

116117
public getHomeAssistantVersions(): SoftwareVersion {

‎webpack.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const __filename = fileURLToPath(import.meta.url);
77
const __dirname = path.dirname(__filename);
88

99
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
10-
const version = packageJson.version || '1.0.0';
10+
const version = packageJson.version || '1.1.0';
1111
const isDev = process.env.NODE_ENV === 'development';
1212
const versionString = `${version}`;
1313

0 commit comments

Comments
 (0)