Skip to content

Commit 3df4110

Browse files
authored
Fix issue with setting version number on release (#2)
* Fix issue with setting version number on release * blackout
1 parent 8bb4189 commit 3df4110

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ jobs:
1414

1515
- name: 🔢 Set version number
1616
run: |
17-
export version=${{ github.ref }}
18-
sed -i '/VERSION = /c\VERSION = "${version##*/}"' "${{ github.workspace }}/custom_components/netdaemon/const.py"
17+
sed -i '/INTEGRATION_VERSION = /c\INTEGRATION_VERSION = "${{ github.ref }}"' "${{ github.workspace }}/custom_components/netdaemon/const.py"
18+
sed -i 's|refs/heads/||' "${{ github.workspace }}/custom_components/netdaemon/const.py"
19+
sed -i 's|refs/tags/||' "${{ github.workspace }}/custom_components/netdaemon/const.py"
1920
2021
- name: 📦 ZIP netdaemon directory
2122
run: |

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ requirements:
99
@python3 -m pip install --upgrade setuptools wheel
1010
@python3 -m pip install -r requirements.txt
1111

12+
black:
13+
@black .

custom_components/netdaemon/const.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
LOGGER: logging.Logger = logging.getLogger(__package__)
55

6-
VERSION = "main"
6+
INTEGRATION_VERSION = "main"
77
DOMAIN = "netdaemon"
88
NAME = "NetDaemon"
99
MINIMUM_HA_VERSION = "2020.12.0"
@@ -19,7 +19,7 @@
1919
STARTUP = f"""
2020
-------------------------------------------------------------------
2121
NetDaemon
22-
Version: {VERSION}
22+
Version: {INTEGRATION_VERSION}
2323
This is a custom integration
2424
If you have any issues with this you need to open an issue here:
2525
https://github.com/hacs/integration/issues

custom_components/netdaemon/entity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from homeassistant.core import callback
33
from homeassistant.helpers.entity import Entity
44

5-
from .const import ND_ID, NAME, DOMAIN
5+
from .const import INTEGRATION_VERSION, ND_ID, NAME, DOMAIN
66

77

88
class NetDaemonEntity(Entity):
@@ -49,6 +49,7 @@ def device_info(self):
4949
return {
5050
"identifiers": {(DOMAIN, ND_ID)},
5151
"name": NAME,
52+
"sw_version": INTEGRATION_VERSION,
5253
"manufacturer": "netdaemon.xyz",
5354
"entry_type": "service",
5455
}

0 commit comments

Comments
 (0)