Skip to content

Commit 88b7ac1

Browse files
authored
Merge pull request #126 from foxey/release-0.7.9
Add reboot button for supported models.
2 parents b65f298 + e6a8746 commit 88b7ac1

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ some basic configuration updates.
6868
| GS108Ev4 | 8 | V1.0.1.3 | |
6969
| GS108PEv3 | 8 | V2.06.24 | V2.06.01 |
7070
| GS110EMX | 10 | V1.0.2.8 | |
71-
| GS116Ev2 | 16 | ? | ? |
71+
| GS116Ev2 | 16 | V2.6.0.48, V2.6.0.50 | ? |
7272
| GS305E | 5 | V1.0.0.16 | V1.0.0.2 |
7373
| GS305EP | 5 | V1.0.1.1 | |
7474
| GS305EPP | 5 | V1.0.1.4 | |

custom_components/netgear_plus/button.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ async def async_setup_entry(
2828
coordinator_switch_infos = config_entry.runtime_data.coordinator_switch_infos
2929

3030
if gs_switch.api:
31+
if gs_switch.api.switch_model.has_reboot_button():
32+
_LOGGER.info(
33+
"[button.async_setup_entry]"
34+
" setting up Platform.BUTTON for Switch Reboot"
35+
)
36+
entities.append(
37+
NetgearRebootButtonEntity(
38+
coordinator=coordinator_switch_infos,
39+
hub=gs_switch,
40+
entity_description=NetgearButtonEntityDescription(
41+
key="reboot",
42+
name="Reboot Switch",
43+
device_class=ButtonDeviceClass.RESTART,
44+
),
45+
)
46+
)
47+
3148
n_poe_ports = 0
3249
if gs_switch.api.poe_ports:
3350
n_poe_ports = len(gs_switch.api.poe_ports)
@@ -37,18 +54,6 @@ async def async_setup_entry(
3754
n_poe_ports,
3855
)
3956

40-
entities.append(
41-
NetgearRebootButtonEntity(
42-
coordinator=coordinator_switch_infos,
43-
hub=gs_switch,
44-
entity_description=NetgearButtonEntityDescription(
45-
key="reboot",
46-
name="Reboot Switch",
47-
device_class=ButtonDeviceClass.RESTART,
48-
),
49-
)
50-
)
51-
5257
if n_poe_ports > 0:
5358
for poe_port in gs_switch.api.poe_ports:
5459
switch_entity = NetgearPoEPowerCycleButtonEntity(

custom_components/netgear_plus/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"documentation": "https://github.com/ckarrie/ha-netgear-plus/blob/main/README.md",
77
"iot_class": "local_polling",
88
"issue_tracker": "https://github.com/ckarrie/ha-netgear-plus/issues",
9-
"requirements": ["lxml>=4.6.1", "py-netgear-plus==v0.4.6"],
9+
"requirements": ["lxml>=4.6.1", "py-netgear-plus==v0.4.7"],
1010
"ssdp": [
1111
{
1212
"manufacturer": "NETGEAR",
1313
"deviceType": "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
1414
}
1515
],
16-
"version": "0.7.8"
16+
"version": "0.7.9"
1717
}

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
colorlog==6.9.0
22
homeassistant>=2024.12.5
33
lxml>=4.6.1
4-
py-netgear-plus==v0.4.6
4+
py-netgear-plus==v0.4.7
55
pip>=21.3.1
66
ruff==0.11.13

0 commit comments

Comments
 (0)