Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed settings #29

Open
Arkoxs opened this issue Sep 29, 2024 · 7 comments
Open

Speed settings #29

Arkoxs opened this issue Sep 29, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@Arkoxs
Copy link

Arkoxs commented Sep 29, 2024

Hi, great job on this HACS integration.
It works for my GS308v3 but I have some issues with the GS105v2 switches.

Would it be possible to add support to change the speed settings on the ports?

I'm currently using a python script to switch between "auto" and "disabled" to turn on different ports. It would be great to control access to ports from HA.

Regards,

@foxey foxey added the enhancement New feature or request label Sep 29, 2024
@foxey
Copy link
Collaborator

foxey commented Jan 26, 2025

@Arkoxs Are you still interested in this feature?
Are you able to contribute by creating a pull request for the Python library that implements the API to the switches?

@Arkoxs
Copy link
Author

Arkoxs commented Jan 27, 2025

@foxey, I'm still interested in this feature but not sure if I'm able to help. Lack of time and experience in Python.
I'll give it a try though.

@foxey
Copy link
Collaborator

foxey commented Jan 27, 2025

I'd like to keep the library as generic as possible, so it would imply that we need to implement it for all models. If you are a very inexperienced developer, this change is not trivial I'm afraid.

@Arkoxs
Copy link
Author

Arkoxs commented Feb 14, 2025

Hi @foxey, do you have time to answer some questions about the parsers.py?

@foxey
Copy link
Collaborator

foxey commented Feb 14, 2025

Sure, what do you want to know?

@Arkoxs
Copy link
Author

Arkoxs commented Feb 14, 2025

Some classes have parse_xxxx defined and some don't.

The class GS108Ev3 is an example, nothing is defined in the class except the init but it works fine.
The class GS105Ev2 is identical but that one results in an error:
File "/usr/local/lib/python3.13/site-packages/py_netgear_plus/parsers.py", line 215, in parse_switch_metadata switch_serial_number = get_first_text(tree, '//table[@id="tbl1"]/tr[3]/td[2]') File "/usr/local/lib/python3.13/site-packages/py_netgear_plus/parsers.py", line 38, in get_first_text raise NetgearPlusPageParserError(message) from error py_netgear_plus.parsers.NetgearPlusPageParserError: XPath //table[@id="tbl1"]/tr[3]/td[2] not found.

Where and how are these switch info pages parsed?

@foxey
Copy link
Collaborator

foxey commented Feb 14, 2025

It works with Class inheritance, so GS108Ev3 is using the methods defined in the parent class (PageParser in this case). I didn't have sample pages for the GS105Ev2 model and therefore assumed (wrongly) that the pages were identical to the other GS105/8 models. Somebody open an issue (#90) for that problem and has provided me with the pages I need to update the parser. After that, the GS105Ev2 class definition will probably has its own parse_switch_metadata class that overrides the one defined in PageParser. Does that clarify the situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants