Vaskivskyi / asusrouter

API wrapper for communication with ASUSWRT-powered routers using HTTP protocol
Apache License 2.0
66 stars 8 forks source link

"Enable block all devices" toggle #402

Closed mzakharo closed 1 year ago

mzakharo commented 1 year ago

Hi,

Thank you for this wonderful library. I tried running the example script and enabling/disabling parental controls, and everything worked like a charm with my Asus-Merlin AXE-16000.

I am trying to toggle internet access to the whole network and there is a setting for it in parental controls, called 'Enable block all devices", however, I do not see any way of toggling it through this project. Is there a way this functionality can be supported?

image

Vaskivskyi commented 1 year ago

Hello, yes, for sure. This feature can be added. Also, this should not take too much time to implement

For not the library contains something I was using or users of my Home Assistant integration asked for.

However, I am always open to implementing more features and making the library compatible with more devices.

P.S. Are you using Merlin 388.4?

mzakharo commented 1 year ago

Hi, I am running 388.1, and yeah, I tried MULTIFILTER_BLOCK_ALL instead of MULTIFILTER_ALL and it worked! Thank you again, this library really rocks, and now I am on my way of implementing total blackout for my network based on a schedule. how nice. Just need to get my home assistant updated, as I see you only support latest versions.

P.S. Enjoy some coffee ;) best of luck with this project.

Vaskivskyi commented 1 year ago

Thanks (:

Unfortunately, Home Assistant is implementing a bit too many changes from time to time. For now, I am not planning on moving further than 2023.10+ as it is currently so that at least several HA main releases will be supported

Vaskivskyi commented 1 year ago

Hey. With 1.3.0 you can:

from asusrouter.modules.parental_control import AsusBlockAll

# Initialize `router` as an AsusRouter here and connect

# Block internet for all
await router.async_set_state(AsusBlockAll.ON)
# Remove the block
await router.async_set_state(AsusBlockAll.OFF)